annotate sat_templates/templates/bulma/components/common.html @ 402:2bbcb7da56bc default tip

bulma: use Font-Awesome instead of Fontello + start of major redesign: - Font-Awesome is now used instead of Fontello, following change in Libervia Media. - This is a beginning of a major redesign of the web templates/web frontend. This currently breaks a lot of thing.
author Goffi <goffi@goffi.org>
date Sat, 26 Oct 2024 22:53:26 +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
402
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
4 {% macro menu(menus, class='is-light') %}
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
5 {{ icon_defs("bell", "circle-user") }}
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
6 {% for menu in menus %}
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
7 {{ icon_defs(menu.icon) }}
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
8 {% endfor %}
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
9 <nav class="navbar main_menu {{class}} {{'is-fixed-top' if menu_fixed_top}}"
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
10 role="navigation" aria-label="main navigation"
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
11 >
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
12
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
13 <div class="navbar-brand">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
14 <a class="navbar-item" href="/">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
15 <img src="{{media_path}}icons/apps/64/sat.png">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
16 </a>
402
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
17 <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="main_menu">
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
18 <span aria-hidden="true"></span>
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
19 <span aria-hidden="true"></span>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
20 <span aria-hidden="true"></span>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
21 <span aria-hidden="true"></span>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
22 </a>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
23 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
24 <div id="main_menu" class="navbar-menu">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
25 <div class="navbar-start">
402
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
26 {% for menu in menus %}
322
11ed664a309c bulma (menu): show active menu
Goffi <goffi@goffi.org>
parents: 312
diff changeset
27 <a
402
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
28 class="navbar-item {% if menu.name == current_page %}is-tab is-active{% endif%}"
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
29 {{ {'href': menu.url}|xmlattr }}
397
b313a7d343af bulma (components/common): open external menu links in blank page (new tab).
Goffi <goffi@goffi.org>
parents: 322
diff changeset
30 {# External links should not replace current page. #}
402
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
31 {% if menu.url.startswith('http:') or menu.url.startswith('https:') -%}target="_blank"{%- endif %}
322
11ed664a309c bulma (menu): show active menu
Goffi <goffi@goffi.org>
parents: 312
diff changeset
32 >
402
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
33 <span class="icon">{{ icon(menu.icon) }}</span>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
34 <span class="menu-item">{{ml.label[menu.name] or menu.name}}</span>
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
35 </a>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
36 {% endfor %}
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 class="navbar-end">
238
0e4a2e0da438 bulma (components/common): fixed language dropdown
Goffi <goffi@goffi.org>
parents: 230
diff changeset
39 <div class="navbar-item has-dropdown is-hoverable">
402
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
40 <span class="menu-item navbar-link"><span class="menu-item">{{locale.language_name}}</span></span>
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
41 <div class="navbar-dropdown">
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
42 {% for l in locales|reject("eq", locale) %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
43 <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
44 {% endfor %}
402
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
45 </div>
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
46
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
47 </div>
402
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
48 <div class="navbar-item" id="menu_notifs">
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
49 <div class="buttons">
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
50 <a class="button is-light">
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
51 <span class="icon">{{ icon("bell") }}</span>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
52 <span class="tag is-danger has-text-white menu-item">3</span>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
53 </a>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
54 <a {{ {'href': login_url}|xmlattr }}>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
55 {% if profile %}
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
56 <div class="button is-light">
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
57 <span class="icon">{{ icon("circle-user") }}</span>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
58 <span class="menu-item">{{profile}}</span>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
59 </div>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
60 {% else %}
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
61 <div class="button is-light">
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
62 <span class="menu-item">Log In</span>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
63 </div>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
64 {% endif %}
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
65 </a>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
66 </div>
2bbcb7da56bc bulma: use Font-Awesome instead of Fontello + start of major redesign:
Goffi <goffi@goffi.org>
parents: 397
diff changeset
67 </div>
230
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
68 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
69 </div>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
70 </nav>
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
71 {% endmacro %}
0e69b5843c2f theme: bulma theme first draft:
Goffi <goffi@goffi.org>
parents:
diff changeset
72
259
a18374320194 bulma (components/common, input/field, input/form): use `xmlattr` for `id`
Goffi <goffi@goffi.org>
parents: 238
diff changeset
73 {% 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
74 <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
75 {% endmacro %}