comparison default/components/common.html @ 66:9834106678da

base: menu implementation: 2 menus are now handled: main menu and category menu (for submenus relative to a page). Main menu is displayed on the side bar on big screen. Added menu for tickets.
author Goffi <goffi@goffi.org>
date Fri, 01 Dec 2017 00:46:42 +0100
parents
children ead4db120515
comparison
equal deleted inserted replaced
65:dd15b6c0b1d3 66:9834106678da
1 {# menu labels, map from menu names to labels #}
2 {% set ml = {
3 'login': _('Session') if profile is defined else _('Log in'),
4 'blog_view': _('Blog'),
5 'merge-requests_list': _('Merge requests'),
6 'merge-request_new': _('Create new merge request'),
7 'tickets_list': _('Tickets'),
8 'ticket_new': _('Create new ticket'),
9 } %}
10
11 {% macro menu(menus, class='') %}
12 <nav class="menu {{class}}">
13 <ul>
14 {% for name,url in menus %}
15 <li><a class="menu_item button {{name}}" {{ {'href': url}|xmlattr }}>{{ml[name]}}</a></li>
16 {% endfor %}
17 </ul>
18 </nav>
19 {% endmacro %}