Mercurial > libervia-templates
comparison 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 |
comparison
equal
deleted
inserted
replaced
401:0e454358ca49 | 402:2bbcb7da56bc |
---|---|
1 {% import 'components/menu_labels.html' as ml with context %} | 1 {% import 'components/menu_labels.html' as ml with context %} |
2 {# We need to use "with context" to disable cache, needed for i18n. #} | 2 {# We need to use "with context" to disable cache, needed for i18n. #} |
3 | 3 |
4 {% macro menu(menus, class='has-background-primary') %} | 4 {% macro menu(menus, class='is-light') %} |
5 <nav class="navbar main_menu {{class}} {{'is-fixed-top' if menu_fixed_top}}"> | 5 {{ icon_defs("bell", "circle-user") }} |
6 {% for menu in menus %} | |
7 {{ icon_defs(menu.icon) }} | |
8 {% endfor %} | |
9 <nav class="navbar main_menu {{class}} {{'is-fixed-top' if menu_fixed_top}}" | |
10 role="navigation" aria-label="main navigation" | |
11 > | |
12 | |
6 <div class="navbar-brand"> | 13 <div class="navbar-brand"> |
7 <a class="navbar-item" href="/"> | 14 <a class="navbar-item" href="/"> |
8 <img src="{{media_path}}icons/apps/64/sat.png"> | 15 <img src="{{media_path}}icons/apps/64/sat.png"> |
9 </a> | 16 </a> |
10 <a role="button" id="main_menu_burger" class="navbar-burger burger" data-target="main_menu"> | 17 <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="main_menu"> |
18 <span aria-hidden="true"></span> | |
11 <span aria-hidden="true"></span> | 19 <span aria-hidden="true"></span> |
12 <span aria-hidden="true"></span> | 20 <span aria-hidden="true"></span> |
13 <span aria-hidden="true"></span> | 21 <span aria-hidden="true"></span> |
14 </a> | 22 </a> |
15 </div> | 23 </div> |
16 <div id="main_menu" class="navbar-menu"> | 24 <div id="main_menu" class="navbar-menu"> |
17 <div class="navbar-start"> | 25 <div class="navbar-start"> |
18 {% for name, url in menus %} | 26 {% for menu in menus %} |
19 <a | 27 <a |
20 class="navbar-item {% if name == current_page %}is-tab is-active{% endif%}" | 28 class="navbar-item {% if menu.name == current_page %}is-tab is-active{% endif%}" |
21 {{ {'href': url}|xmlattr }} | 29 {{ {'href': menu.url}|xmlattr }} |
22 {# External links should not replace current page. #} | 30 {# External links should not replace current page. #} |
23 {% if url.startswith('http:') or url.startswith('https:') -%}target="_blank"{%- endif %} | 31 {% if menu.url.startswith('http:') or menu.url.startswith('https:') -%}target="_blank"{%- endif %} |
24 > | 32 > |
25 {{ml.label[name] or name}} | 33 <span class="icon">{{ icon(menu.icon) }}</span> |
34 <span class="menu-item">{{ml.label[menu.name] or menu.name}}</span> | |
26 </a> | 35 </a> |
27 {% endfor %} | 36 {% endfor %} |
28 </div> | 37 </div> |
29 <div class="navbar-end"> | 38 <div class="navbar-end"> |
30 <div class="navbar-item has-dropdown is-hoverable"> | 39 <div class="navbar-item has-dropdown is-hoverable"> |
31 <span class="navbar-link">{{locale.language_name}}</span> | 40 <span class="menu-item navbar-link"><span class="menu-item">{{locale.language_name}}</span></span> |
32 <div class="navbar-dropdown"> | 41 <div class="navbar-dropdown"> |
33 {% for l in locales|reject("eq", locale) %} | 42 {% for l in locales|reject("eq", locale) %} |
34 <a class="navbar-item" href="?{{C.KEY_LANG}}={{l}}">{{l.language_name}}</a> | 43 <a class="navbar-item" href="?{{C.KEY_LANG}}={{l}}">{{l.language_name}}</a> |
35 {% endfor %} | 44 {% endfor %} |
45 </div> | |
36 | 46 |
47 </div> | |
48 <div class="navbar-item" id="menu_notifs"> | |
49 <div class="buttons"> | |
50 <a class="button is-light"> | |
51 <span class="icon">{{ icon("bell") }}</span> | |
52 <span class="tag is-danger has-text-white menu-item">3</span> | |
53 </a> | |
54 <a {{ {'href': login_url}|xmlattr }}> | |
55 {% if profile %} | |
56 <div class="button is-light"> | |
57 <span class="icon">{{ icon("circle-user") }}</span> | |
58 <span class="menu-item">{{profile}}</span> | |
59 </div> | |
60 {% else %} | |
61 <div class="button is-light"> | |
62 <span class="menu-item">Log In</span> | |
63 </div> | |
64 {% endif %} | |
65 </a> | |
66 </div> | |
37 </div> | 67 </div> |
38 </div> | 68 </div> |
39 </div> | 69 </div> |
40 </nav> | 70 </nav> |
41 {% endmacro %} | 71 {% endmacro %} |