diff sat_templates/templates/bulma/base/base.html @ 312:6411615771b6

bulma (base): menu can now be fixed on top with `menu_fixed_top` bool variable
author Goffi <goffi@goffi.org>
date Fri, 19 Mar 2021 15:51:26 +0100
parents c9396c3711e4
children 34b8de7be336
line wrap: on
line diff
--- a/sat_templates/templates/bulma/base/base.html	Fri Mar 19 15:49:51 2021 +0100
+++ b/sat_templates/templates/bulma/base/base.html	Fri Mar 19 15:51:26 2021 +0100
@@ -1,4 +1,12 @@
- {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #}
+{# base template managing common layout, blocks, links or scripts
+
+    except for special pages, this template should always be extended.
+
+    @variable menu_fixed_top(bool): if true, the menu will always stay on top, and padding will be added to body accordingly.
+#}
+
+
+{# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #}
 {% set embedded = True %}
 {% import 'components/common.html' as component with context %}
 {{ script.include('common', '') }} {# common.js is, as its name states, a common script, so it's useful to import it here #}
@@ -72,7 +80,7 @@
         <link rel="icon" href="{{media_path}}icons/apps/64/sat.png">
     {% endblock favicon %}
 </head>
-<body{{ {'onload': body_onload} | xmlattr }}{{ ' class="body--fullscreen"'|safe if full_screen_body }}>
+<body{{ {'onload': body_onload} | xmlattr }} class="{{' body--fullscreen' if full_screen_body}}{{' has-navbar-fixed-top' if menu_fixed_top}}">
     {% if atom_url is defined %}
         {{ icon_defs('feed') }}
     {% endif %}
@@ -91,7 +99,7 @@
     {% endif %}
     {% if main_menu %}
         {% block main_menu %}
-            {{ component.menu(main_menu, class="main_menu") }}
+            {{ component.menu(main_menu) }}
         {% endblock main_menu %}
     {% endif %}
     {% block body_wrapper %}