comparison 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
comparison
equal deleted inserted replaced
65:dd15b6c0b1d3 66:9834106678da
1 {% set embedded = True %} {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #} 1 {% set embedded = True %} {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #}
2 {% import 'components/common.html' as component with context %}
2 {{ script.include('css') }} {# css.js is a common script, so it's useful to import it here #} 3 {{ script.include('css') }} {# css.js is a common script, so it's useful to import it here #}
3 <!DOCTYPE html> 4 <!DOCTYPE html>
4 <html> 5 <html>
5 <head> 6 <head>
6 <meta charset="utf-8" /> 7 <meta charset="utf-8" />
33 {% endif %} 34 {% endif %}
34 35
35 {{ script.generate_scripts() }} 36 {{ script.generate_scripts() }}
36 </head> 37 </head>
37 <body> 38 <body>
39 {% if main_menu is defined %}
40 {% block main_menu %}
41 {{ component.menu(main_menu, class="main_menu") }}
42 {% endblock main_menu %}
43 {% endif %}
38 44
39 <header> 45 <div id='main_area'>
40 {% if confirm %} 46 <header>
41 {# confirmation message used when post data has been handled correctly #} 47 {% if confirm %}
42 {% block confirm %} 48 {# confirmation message used when post data has been handled correctly #}
43 <div class="box post_confirm"> 49 {% block confirm %}
44 {% block confirm_message %} 50 <div class="box post_confirm">
45 {% trans %}Your data has been sent correctly.{% endtrans %} 51 {% block confirm_message %}
46 {% endblock confirm_message %} 52 {% trans %}Your data has been sent correctly.{% endtrans %}
47 </div> 53 {% endblock confirm_message %}
48 {% endblock confirm %} 54 </div>
49 {% endif %} 55 {% endblock confirm %}
56 {% endif %}
50 57
51 {% if menus %} 58 </header>
52 {% block menu %}
53 <nav class="menu">
54 <ul>
55 {% for url,label,cls in menus %}
56 <li><a class="menu_item button {{cls}}" {{ {'href': url}|xmlattr }}>{{ label }}</a></li>
57 {% endfor %}
58 </ul>
59 </nav>
60 {% endblock menu %}
61 {% endif %}
62 </header>
63 59
64 <div id="body"> 60 <div id="body">
65 {% block body %} 61 {% block category_menu scoped %}
66 {% endblock body %} 62 {% if category_menu is defined %}
63 {{ component.menu(category_menu, class="category_menu") }}
64 {% endif %}
65 {% endblock category_menu %}
66 {% block body %}
67 {% endblock body %}
68 </div>
69 <footer>{% block footer %}{% trans app_name=C.APP_NAME %}Powered by {{app_name}}{% endtrans %}{% endblock %}</footer>
67 </div> 70 </div>
68 <footer>{% block footer %}{% trans app_name=C.APP_NAME %}Powered by {{app_name}}{% endtrans %}{% endblock %}</footer>
69 </body> 71 </body>
70 </html> 72 </html>