[IMP] website: In the top menu, we should see the active page

bzr revid: chm@openerp.com-20140121154348-1y6uqc6t2oveae7i
This commit is contained in:
Christophe Matthieu
2014-01-21 16:43:48 +01:00
parent b38d4d8a81
commit 87d6f608da
+8 -2
View File
@@ -12,12 +12,18 @@
</template>
<template id="website.submenu" name="Submenu">
<li t-if="not submenu.child_id">
<li t-if="not submenu.child_id" t-att-class="
((submenu.url != '/' and request.httprequest.path.startswith(submenu.url)) or
request.httprequest.path == submenu.url) and 'active'
">
<a t-att-href="url_for(submenu.url)" 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" class="dropdown">
<li t-if="submenu.child_id" t-attf-class="dropdown #{
((submenu.url != '/' and [1 for submenu in submenu.child_id if request.httprequest.path.startswith(submenu.url)]) or
request.httprequest.path == submenu.url) and 'active'
}">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<span t-field="submenu.name"/> <span class="caret" t-ignore="true"></span>
</a>