230
|
1 {% import 'components/menu_labels.html' as ml with context %} |
|
2 {# we need to use "with context" to disable cache, needed for i18n #} |
|
3 |
|
4 {% macro menu(menus, class='') %} |
|
5 <nav class="navbar has-background-primary"> |
|
6 <div class="navbar-brand"> |
|
7 <a class="navbar-item" href="/"> |
|
8 <img src="{{media_path}}icons/apps/64/sat.png"> |
|
9 </a> |
|
10 <a role="button" id="main_menu_burger" class="navbar-burger burger" data-target="main_menu"> |
|
11 <span aria-hidden="true"></span> |
|
12 <span aria-hidden="true"></span> |
|
13 <span aria-hidden="true"></span> |
|
14 </a> |
|
15 </div> |
|
16 <div id="main_menu" class="navbar-menu"> |
|
17 <div class="navbar-start"> |
|
18 {% for name, url in menus %} |
|
19 <a class="navbar-item" {{ {'href': url}|xmlattr }}> |
|
20 {{name}} |
|
21 </a> |
|
22 {% endfor %} |
|
23 </div> |
|
24 <div class="navbar-end"> |
|
25 <div class="navbar-item has-dropdown x-is-hoverable"> |
|
26 <span class="navbar-link">{{locale.language_name}}</span> |
|
27 <div class="navbar-dropdown"> |
|
28 {% for l in locales|reject("eq", locale) %} |
|
29 <a class="navbar-item" href="?{{C.KEY_LANG}}={{l}}">{{l.language_name}}</a> |
|
30 {% endfor %} |
|
31 |
|
32 </div> |
|
33 </div> |
|
34 </div> |
|
35 </nav> |
|
36 {% endmacro %} |
|
37 |
|
38 {% macro action_button(url, label=_("create"), icon="plus-circled", class="is-primary is-rounded") %} |
|
39 <a class="button {{class}}" {{ {"href":url} | xmlattr }}><i class="icon-{{icon}}"></i> {{label}}</a> |
|
40 {% endmacro %} |