diff default/base/base.html @ 61:f76ec90e0e1e

base: menus handling, first draft: this is a very basic way to handle menu (big buttons on the top), just a first draft to be able to navigate.
author Goffi <goffi@goffi.org>
date Sat, 11 Nov 2017 00:16:35 +0100
parents 37fd11d71233
children 9834106678da
line wrap: on
line diff
--- a/default/base/base.html	Sat Nov 11 00:14:23 2017 +0100
+++ b/default/base/base.html	Sat Nov 11 00:16:35 2017 +0100
@@ -36,16 +36,30 @@
 </head>
 <body>
 
-    {% if confirm %}
-    {# confirmation message used when post data has been handled correctly #}
-        {% block confirm %}
-            <div class="box post_confirm">
-                {% block confirm_message %}
-                    {% trans %}Your data has been sent correctly.{% endtrans %}
-                {% endblock confirm_message %}
-            </div>
-        {% endblock confirm %}
-    {% endif %}
+    <header>
+        {% if confirm %}
+        {# confirmation message used when post data has been handled correctly #}
+            {% block confirm %}
+                <div class="box post_confirm">
+                    {% block confirm_message %}
+                        {% trans %}Your data has been sent correctly.{% endtrans %}
+                    {% endblock confirm_message %}
+                </div>
+            {% endblock confirm %}
+        {% endif %}
+
+        {% if menus %}
+            {% block menu %}
+                <nav class="menu">
+                    <ul>
+                    {% for url,label,cls in menus %}
+                        <li><a class="menu_item button {{cls}}" {{ {'href': url}|xmlattr }}>{{ label }}</a></li>
+                    {% endfor %}
+                    </ul>
+                </nav>
+            {% endblock menu %}
+        {% endif %}
+    </header>
 
     <div id="body">
     {% block body %}