diff default/base/base.html @ 66:9834106678da

base: menu implementation: 2 menus are now handled: main menu and category menu (for submenus relative to a page). Main menu is displayed on the side bar on big screen. Added menu for tickets.
author Goffi <goffi@goffi.org>
date Fri, 01 Dec 2017 00:46:42 +0100
parents f76ec90e0e1e
children 90a303a14112
line wrap: on
line diff
--- a/default/base/base.html	Wed Nov 15 08:52:14 2017 +0100
+++ b/default/base/base.html	Fri Dec 01 00:46:42 2017 +0100
@@ -1,4 +1,5 @@
 {% set embedded = True %} {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #}
+{% import 'components/common.html' as component with context %}
 {{ script.include('css') }} {# css.js is a common script, so it's useful to import it here #}
 <!DOCTYPE html>
 <html>
@@ -35,36 +36,37 @@
     {{ script.generate_scripts() }}
 </head>
 <body>
-
-    <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 main_menu is defined %}
+        {% block main_menu %}
+            {{ component.menu(main_menu, class="main_menu") }}
+        {% endblock main_menu %}
+    {% 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='main_area'>
+        <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 %}
 
-    <div id="body">
-    {% block body %}
-    {% endblock body %}
+        </header>
+
+        <div id="body">
+        {% block category_menu scoped %}
+            {% if category_menu is defined %}
+                {{ component.menu(category_menu, class="category_menu") }}
+            {% endif %}
+        {% endblock category_menu %}
+        {% block body %}
+        {% endblock body %}
+        </div>
+        <footer>{% block footer %}{% trans app_name=C.APP_NAME %}Powered by {{app_name}}{% endtrans %}{% endblock %}</footer>
     </div>
-    <footer>{% block footer %}{% trans app_name=C.APP_NAME %}Powered by {{app_name}}{% endtrans %}{% endblock %}</footer>
 </body>
 </html>