[FIX] website, *: BS4, restore website menu dropdowns
* website_event, website_event_track
This commit is contained in:
@@ -90,26 +90,28 @@
|
||||
|
||||
<!-- Layout -->
|
||||
<template id="submenu" name="Submenu">
|
||||
<li t-if="submenu.is_visible and not submenu.child_id.filtered(lambda menu: menu.is_visible)" t-attf-class="#{('%s-item ' % submenu_type) if submenu_type else ''}">
|
||||
<t t-set="has_visible_submenu" t-value="submenu.child_id.filtered(lambda menu: menu.is_visible)"/>
|
||||
<li t-if="submenu.is_visible and not has_visible_submenu" t-attf-class="#{item_class or ''}">
|
||||
<a t-att-href="submenu.clean_url()"
|
||||
t-attf-class="#{'nav-link' if submenu_type != 'breadcrumb' else ''} #{' active' if submenu.clean_url() and unslug_url(request.httprequest.path) == unslug_url(submenu.clean_url()) else ''}"
|
||||
t-attf-class="#{link_class or ''} #{'active' if submenu.clean_url() and unslug_url(request.httprequest.path) == unslug_url(submenu.clean_url()) else ''}"
|
||||
role="menuitem"
|
||||
t-ignore="true"
|
||||
t-att-target="'_blank' if submenu.new_window else None">
|
||||
<span t-field="submenu.name"/>
|
||||
</a>
|
||||
</li>
|
||||
<li t-if="submenu.child_id.filtered(lambda menu: menu.is_visible)" t-attf-class="#{('%s-item ' % submenu_type) if submenu_type else ''}dropdown #{
|
||||
<li t-if="has_visible_submenu" t-attf-class="#{item_class or ''} dropdown #{
|
||||
(submenu.clean_url() and submenu.clean_url() != '/' and any([request.httprequest.path == child.url for child in submenu.child_id if child.url]) or
|
||||
(submenu.clean_url() and request.httprequest.path == submenu.clean_url())) and 'active'
|
||||
}">
|
||||
<a t-attf-class="#{('%s-link ' % submenu_type) if submenu_type else ''}dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<a t-attf-class="#{link_class or ''} dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<span t-field="submenu.name"/>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<t t-foreach="submenu.child_id" t-as="submenu">
|
||||
<t t-call="website.submenu">
|
||||
<t t-set="submenu_type" t-value="'dropdown'"/>
|
||||
<t t-set="item_class" t-value="None"/>
|
||||
<t t-set="link_class" t-value="'dropdown-item'"/>
|
||||
</t>
|
||||
</t>
|
||||
</ul>
|
||||
@@ -220,7 +222,8 @@
|
||||
<xpath expr="//header//ul[@id='top_menu']/li[hasclass('divider')]" position="before">
|
||||
<t t-foreach="website.menu_id.child_id" t-as="submenu">
|
||||
<t t-call="website.submenu">
|
||||
<t t-set="submenu_type" t-value="'nav'"/>
|
||||
<t t-set="item_class" t-value="'nav-item'"/>
|
||||
<t t-set="link_class" t-value="'nav-link'"/>
|
||||
</t>
|
||||
</t>
|
||||
</xpath>
|
||||
|
||||
@@ -220,7 +220,8 @@
|
||||
<ol name="Event Menu" class="breadcrumb mb0" id="event_menu" t-if="event.menu_id" t-att-data-content_menu_id="editable and event.menu_id.id">
|
||||
<t t-foreach="event.menu_id.child_id" t-as="submenu">
|
||||
<t t-call="website.submenu">
|
||||
<t t-set="submenu_type" t-value="'breadcrumb'"/>
|
||||
<t t-set="item_class" t-value="'breadcrumb-item'"/>
|
||||
<t t-set="link_class" t-value="None"/>
|
||||
</t>
|
||||
</t>
|
||||
</ol>
|
||||
|
||||
@@ -191,7 +191,8 @@
|
||||
<ol name="Event Menu" class="breadcrumb mb0" id="event_menu" t-if="event.menu_id" t-att-data-content_menu_id="editable and event.menu_id.id">
|
||||
<t t-foreach="event.menu_id.child_id" t-as="submenu">
|
||||
<t t-call="website.submenu">
|
||||
<t t-set="submenu_type" t-value="'breadcrumb'"/>
|
||||
<t t-set="item_class" t-value="'breadcrumb-item'"/>
|
||||
<t t-set="link_class" t-value="None"/>
|
||||
</t>
|
||||
</t>
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user