[FIX] website: check that menu has an url.
Check that url is setted before to use it (avoid traceback with startwith). Field is not required because website.menu are using to create tree/sub menu Change the behavior of new_window. Use _blank and not blank... for links. Blank has no sense in this context.
This commit is contained in:
parent
f025d3e17c
commit
2c865db504
|
@ -33,15 +33,15 @@
|
|||
|
||||
<template id="website.submenu" name="Submenu">
|
||||
<li t-if="not submenu.child_id" t-att-class="
|
||||
((submenu.url != '/' and request.httprequest.path.startswith(submenu.url)) or
|
||||
((submenu.url and submenu.url != '/' and request.httprequest.path.startswith(submenu.url)) or
|
||||
request.httprequest.path == submenu.url) and 'active'
|
||||
">
|
||||
<a t-att-href="(website.menu_id.child_id[0] == submenu) and '/' or submenu.url" t-ignore="true" t-att-target="'blank' if submenu.new_window else None">
|
||||
<a t-att-href="(website.menu_id.child_id[0] == submenu) and '/' or 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" t-attf-class="dropdown #{
|
||||
((submenu.url != '/' and [1 for submenu in submenu.child_id if request.httprequest.path.startswith(submenu.url)]) or
|
||||
((submenu.url and 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="#">
|
||||
|
|
Loading…
Reference in New Issue