Mercurial > libervia-templates
annotate sat_templates/templates/bulma/components/common.html @ 373:c5609be6c34e
bulma (list/item): add `safe` to "body" which is a cleaned xhtml value
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 14 Aug 2023 17:01:35 +0200 |
parents | 11ed664a309c |
children | b313a7d343af |
rev | line source |
---|---|
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 | |
312
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
290
diff
changeset
|
4 {% macro menu(menus, class='has-background-primary') %} |
6411615771b6
bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
Goffi <goffi@goffi.org>
parents:
290
diff
changeset
|
5 <nav class="navbar main_menu {{class}} {{'is-fixed-top' if menu_fixed_top}}"> |
230 | 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 %} | |
322 | 19 <a |
20 class="navbar-item {% if name == current_page %}is-tab is-active{% endif%}" | |
21 {{ {'href': url}|xmlattr }} | |
22 > | |
290
1743fd741fed
bulma (components/common): use `menu_labels.html` to translate menus
Goffi <goffi@goffi.org>
parents:
259
diff
changeset
|
23 {{ml.label[name] or name}} |
230 | 24 </a> |
25 {% endfor %} | |
26 </div> | |
27 <div class="navbar-end"> | |
238
0e4a2e0da438
bulma (components/common): fixed language dropdown
Goffi <goffi@goffi.org>
parents:
230
diff
changeset
|
28 <div class="navbar-item has-dropdown is-hoverable"> |
230 | 29 <span class="navbar-link">{{locale.language_name}}</span> |
30 <div class="navbar-dropdown"> | |
31 {% for l in locales|reject("eq", locale) %} | |
32 <a class="navbar-item" href="?{{C.KEY_LANG}}={{l}}">{{l.language_name}}</a> | |
33 {% endfor %} | |
34 | |
35 </div> | |
36 </div> | |
37 </div> | |
38 </nav> | |
39 {% endmacro %} | |
40 | |
259
a18374320194
bulma (components/common, input/field, input/form): use `xmlattr` for `id`
Goffi <goffi@goffi.org>
parents:
238
diff
changeset
|
41 {% macro action_button(url, label=_("create"), icon="plus-circled", class="is-primary is-rounded", id=none) %} |
a18374320194
bulma (components/common, input/field, input/form): use `xmlattr` for `id`
Goffi <goffi@goffi.org>
parents:
238
diff
changeset
|
42 <a class="button {{class}}" {{ {"href":url, "id": id} | xmlattr }}><i class="icon-{{icon}}"></i> {{label}}</a> |
230 | 43 {% endmacro %} |