Mercurial > libervia-templates
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 |
rev | line source |
---|---|
230 | 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 | 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 | 13 <div class="navbar-brand"> |
14 <a class="navbar-item" href="/"> | |
15 <img src="{{media_path}}icons/apps/64/sat.png"> | |
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 | 19 <span aria-hidden="true"></span> |
20 <span aria-hidden="true"></span> | |
21 <span aria-hidden="true"></span> | |
22 </a> | |
23 </div> | |
24 <div id="main_menu" class="navbar-menu"> | |
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 | 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 | 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 | 35 </a> |
36 {% endfor %} | |
37 </div> | |
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 | 41 <div class="navbar-dropdown"> |
42 {% for l in locales|reject("eq", locale) %} | |
43 <a class="navbar-item" href="?{{C.KEY_LANG}}={{l}}">{{l.language_name}}</a> | |
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 | 46 |
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 | 68 </div> |
69 </div> | |
70 </nav> | |
71 {% endmacro %} | |
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 | 75 {% endmacro %} |