comparison sat_templates/templates/default/base/base.html @ 164:e9f0a4215e46

multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
author Goffi <goffi@goffi.org>
date Mon, 10 Sep 2018 08:53:33 +0200
parents sat_templates/default/base/base.html@33c7ce833d3f
children 9e8d9d754337
comparison
equal deleted inserted replaced
163:33f67228686a 164:e9f0a4215e46
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 %}
3 {{ script.include('common', '') }} {# common.js is, as its name state, a common script, so it's useful to import it here #}
4 <!DOCTYPE html>
5 <html>
6 <head>
7 <meta charset="utf-8">
8 <meta name="viewport" content="width=device-width, initial-scale=1">
9
10 {% if norobots %}
11 <meta name="robots" content="noindex, nofollow">
12 {% endif %}
13
14 <title>{% block title %}{{C.APP_NAME}}{% endblock %}</title>
15
16 {% if css_content is defined %}
17 <style type="text/css">
18 {{css_content}}
19 </style>
20 {% if css_content_noscript is defined %}
21 <noscript>
22 <style type="text/css">
23 {{css_content_noscript}}
24 </style>
25 </noscript>
26 {% endif %}
27 {% else %}
28 {% for css_file in css_files %}
29 <link rel='stylesheet' type="text/css" href='{{css_file}}'>
30 {% endfor %}
31 {% if css_files_noscript %}
32 <noscript>
33 {% for css_file in css_files_noscript %}
34 <link rel='stylesheet' type="text/css" href='{{css_file}}'>
35 {% endfor %}
36 </noscript>
37 {% endif %}
38 {% endif %}
39
40 {% if xmpp_uri is defined %}
41 <link rel="alternate" type="application/atom+xml" href="{{xmpp_uri}}" >
42 {% endif %}
43
44 {% if dynamic_style is defined %}
45 {# be extra careful about dynamic style, insure escaping if you use untrusted values ! #}
46 <style type="text/css">
47 {{dynamic_style}}
48 </style>
49 {% endif %}
50
51 {# JS handling #}
52 {% if websocket is defined %}
53 {{ script.include('websocket', '') }}
54 {% endif %}
55 {{ script.generate_scripts() }}
56 {% if websocket is defined %}
57 <script>var socket=new WSHandler("{{websocket.url}}", "{{websocket.token}}", {{websocket.debug}});</script>
58 {% endif %}
59
60 {% block favicon %}
61 <link rel="icon" href="{{media_path}}icons/apps/64/sat.png">
62 {% endblock favicon %}
63 </head>
64 <body>
65 {% if main_menu is defined %}
66 {% block main_menu %}
67 {{ component.menu(main_menu, class="main_menu") }}
68 {% endblock main_menu %}
69 {% endif %}
70
71 <main id='main_area'>
72 <header>
73 {% if confirm %}
74 {# confirmation message used when post data has been handled correctly #}
75 {% block confirm %}
76 <div class="box post_confirm">
77 {% block confirm_message %}
78 {% trans %}Your data has been sent correctly.{% endtrans %}
79 {% endblock confirm_message %}
80 </div>
81 {% endblock confirm %}
82 {% endif %}
83
84 </header>
85
86 <div id="body">
87 {% block category_menu scoped %}
88 {% if category_menu is defined %}
89 {{ component.menu(category_menu, class="category_menu") }}
90 {% endif %}
91 {% endblock category_menu %}
92 {% block body %}
93 {% endblock body %}
94 </div>
95 <footer>{% block footer %}<span>{% trans app_name=C.APP_NAME %}Powered by {{app_name}}{% endtrans %}</span>{% endblock %}</footer>
96 </main>
97 </body>
98 </html>