diff 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
line wrap: on
line diff
--- a/sat_templates/templates/bulma/components/common.html	Wed Oct 02 17:23:03 2024 +0200
+++ b/sat_templates/templates/bulma/components/common.html	Sat Oct 26 22:53:26 2024 +0200
@@ -1,13 +1,21 @@
 {% import 'components/menu_labels.html' as ml with context %}
 {# We need to use "with context" to disable cache, needed for i18n. #}
 
-{% macro menu(menus, class='has-background-primary') %}
-    <nav class="navbar main_menu {{class}} {{'is-fixed-top' if menu_fixed_top}}">
+{% macro menu(menus, class='is-light') %}
+    {{ icon_defs("bell", "circle-user") }}
+    {% for menu in menus %}
+        {{ icon_defs(menu.icon) }}
+    {% endfor %}
+    <nav class="navbar main_menu {{class}} {{'is-fixed-top' if menu_fixed_top}}"
+         role="navigation" aria-label="main navigation"
+    >
+
         <div class="navbar-brand">
             <a class="navbar-item" href="/">
               <img src="{{media_path}}icons/apps/64/sat.png">
             </a>
-            <a role="button" id="main_menu_burger" class="navbar-burger burger" data-target="main_menu">
+            <a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="main_menu">
+                <span aria-hidden="true"></span>
                 <span aria-hidden="true"></span>
                 <span aria-hidden="true"></span>
                 <span aria-hidden="true"></span>
@@ -15,26 +23,48 @@
         </div>
         <div id="main_menu" class="navbar-menu">
             <div class="navbar-start">
-            {% for name, url in menus %}
+            {% for menu in menus %}
                 <a
-                    class="navbar-item {% if name == current_page %}is-tab is-active{% endif%}"
-                    {{ {'href': url}|xmlattr }}
+                    class="navbar-item {% if menu.name == current_page %}is-tab is-active{% endif%}"
+                    {{ {'href': menu.url}|xmlattr }}
                     {# External links should not replace current page. #}
-                    {% if url.startswith('http:') or url.startswith('https:') -%}target="_blank"{%- endif %}
+                    {% if menu.url.startswith('http:') or menu.url.startswith('https:') -%}target="_blank"{%- endif %}
                 >
-                    {{ml.label[name] or name}}
+                    <span class="icon">{{ icon(menu.icon) }}</span>
+                    <span class="menu-item">{{ml.label[menu.name] or menu.name}}</span>
                   </a>
             {% endfor %}
             </div>
             <div class="navbar-end">
                 <div class="navbar-item has-dropdown is-hoverable">
-                    <span class="navbar-link">{{locale.language_name}}</span>
+                    <span class="menu-item navbar-link"><span class="menu-item">{{locale.language_name}}</span></span>
                     <div class="navbar-dropdown">
                         {% for l in locales|reject("eq", locale) %}
                             <a class="navbar-item" href="?{{C.KEY_LANG}}={{l}}">{{l.language_name}}</a>
                         {% endfor %}
+                    </div>
 
                 </div>
+                <div class="navbar-item" id="menu_notifs">
+                    <div class="buttons">
+                        <a class="button is-light">
+                            <span class="icon">{{ icon("bell") }}</span>
+                            <span class="tag is-danger has-text-white menu-item">3</span>
+                        </a>
+                        <a {{ {'href': login_url}|xmlattr }}>
+                            {% if profile %}
+                                <div class="button is-light">
+                                    <span class="icon">{{ icon("circle-user") }}</span>
+                                    <span class="menu-item">{{profile}}</span>
+                                </div>
+                            {% else %}
+                                <div class="button is-light">
+                                    <span class="menu-item">Log In</span>
+                                </div>
+                            {% endif %}
+                        </a>
+                    </div>
+                </div>
             </div>
         </div>
     </nav>