annotate sat_templates/templates/bulma/components/common.html @ 399:e7152fc8a81f default tip

bulma (components/search_item): explicitely import "avatar".
author Goffi <goffi@goffi.org>
date Thu, 06 Jun 2024 15:22:22 +0200
parents b313a7d343af
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
1 {% import 'components/menu_labels.html' as ml with context %}
397
b313a7d343af bulma (components/common): open external menu links in blank page (new tab).
Goffi <goffi@goffi.org>
parents: 322
diff changeset
2 {# We need to use "with context" to disable cache, needed for i18n. #}
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
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
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
6 <div class="navbar-brand">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
7 <a class="navbar-item" href="/">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
8 <img src="{{media_path}}icons/apps/64/sat.png">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
9 </a>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
10 <a role="button" id="main_menu_burger" class="navbar-burger burger" data-target="main_menu">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
11 <span aria-hidden="true"></span>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
12 <span aria-hidden="true"></span>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
13 <span aria-hidden="true"></span>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 </a>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
16 <div id="main_menu" class="navbar-menu">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
17 <div class="navbar-start">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
18 {% for name, url in menus %}
322
11ed664a309c bulma (menu): show active menu
Goffi <goffi@goffi.org>
parents: 312
diff changeset
19 <a
11ed664a309c bulma (menu): show active menu
Goffi <goffi@goffi.org>
parents: 312
diff changeset
20 class="navbar-item {% if name == current_page %}is-tab is-active{% endif%}"
11ed664a309c bulma (menu): show active menu
Goffi <goffi@goffi.org>
parents: 312
diff changeset
21 {{ {'href': url}|xmlattr }}
397
b313a7d343af bulma (components/common): open external menu links in blank page (new tab).
Goffi <goffi@goffi.org>
parents: 322
diff changeset
22 {# External links should not replace current page. #}
b313a7d343af bulma (components/common): open external menu links in blank page (new tab).
Goffi <goffi@goffi.org>
parents: 322
diff changeset
23 {% if url.startswith('http:') or url.startswith('https:') -%}target="_blank"{%- endif %}
322
11ed664a309c bulma (menu): show active menu
Goffi <goffi@goffi.org>
parents: 312
diff changeset
24 >
290
1743fd741fed bulma (components/common): use `menu_labels.html` to translate menus
Goffi <goffi@goffi.org>
parents: 259
diff changeset
25 {{ml.label[name] or name}}
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
26 </a>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
27 {% endfor %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
28 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
29 <div class="navbar-end">
238
0e4a2e0da438 bulma (components/common): fixed language dropdown
Goffi <goffi@goffi.org>
parents: 230
diff changeset
30 <div class="navbar-item has-dropdown is-hoverable">
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
31 <span class="navbar-link">{{locale.language_name}}</span>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
32 <div class="navbar-dropdown">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
33 {% for l in locales|reject("eq", locale) %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
34 <a class="navbar-item" href="?{{C.KEY_LANG}}={{l}}">{{l.language_name}}</a>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
35 {% endfor %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
36
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
37 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
38 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
39 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
40 </nav>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
41 {% endmacro %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
42
259
a18374320194 bulma (components/common, input/field, input/form): use `xmlattr` for `id`
Goffi <goffi@goffi.org>
parents: 238
diff changeset
43 {% 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
44 <a class="button {{class}}" {{ {"href":url, "id": id} | xmlattr }}><i class="icon-{{icon}}"></i> {{label}}</a>
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
45 {% endmacro %}