annotate sat_templates/templates/default/base/base.html @ 190:cda2aad3eed0

base: "links" template variable can now be used: if "links" is present in template data, it must be a list of dictionaries, the dictionaries will be used as attributes for the "<link>" elements in the header.
author Goffi <goffi@goffi.org>
date Fri, 26 Apr 2019 08:44:38 +0200
parents 240bbac435f4
children a1fa6744c78e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
7a1626e78d53 base: an embedded variable is set when base is used, this way we can have include templates without including the whole page with base
Goffi <goffi@goffi.org>
parents: 1
diff changeset
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) #}
66
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
2 {% import 'components/common.html' as component with context %}
164
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
3 {{ script.include('common', '') }} {# common.js is, as its name state, a common script, so it's useful to import it here #}
166
178f55b825b7 small refactoring/redesign, better BEM integration:
Goffi <goffi@goffi.org>
parents: 165
diff changeset
4 {{ script.include('dom_update') }} {# will check page for dom element to modify when javascript is enabled #}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
5 <!DOCTYPE html>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
6 <html>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
7 <head>
75
9471c7309ecc base: added viewport meta
Goffi <goffi@goffi.org>
parents: 70
diff changeset
8 <meta charset="utf-8">
9471c7309ecc base: added viewport meta
Goffi <goffi@goffi.org>
parents: 70
diff changeset
9 <meta name="viewport" content="width=device-width, initial-scale=1">
25
b046a7835374 base/base.html: if norobots is set, add a <meta> to tell robots no to index or follow this page.
Goffi <goffi@goffi.org>
parents: 20
diff changeset
10
b046a7835374 base/base.html: if norobots is set, add a <meta> to tell robots no to index or follow this page.
Goffi <goffi@goffi.org>
parents: 20
diff changeset
11 {% if norobots %}
b046a7835374 base/base.html: if norobots is set, add a <meta> to tell robots no to index or follow this page.
Goffi <goffi@goffi.org>
parents: 20
diff changeset
12 <meta name="robots" content="noindex, nofollow">
b046a7835374 base/base.html: if norobots is set, add a <meta> to tell robots no to index or follow this page.
Goffi <goffi@goffi.org>
parents: 20
diff changeset
13 {% endif %}
b046a7835374 base/base.html: if norobots is set, add a <meta> to tell robots no to index or follow this page.
Goffi <goffi@goffi.org>
parents: 20
diff changeset
14
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
15 <title>{% block title %}{{C.APP_NAME}}{% endblock %}</title>
26
d782227c088d base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents: 25
diff changeset
16
1
b13a26d55c64 base: updated CSS handling to follow changes in backend, moved CSS file to /static with splitted files
Goffi <goffi@goffi.org>
parents: 0
diff changeset
17 {% if css_content is defined %}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
18 <style type="text/css">
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
19 {{css_content}}
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
20 </style>
164
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
21 {% if css_content_noscript is defined %}
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
22 <noscript>
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
23 <style type="text/css">
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
24 {{css_content_noscript}}
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
25 </style>
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
26 </noscript>
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
27 {% endif %}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
28 {% else %}
1
b13a26d55c64 base: updated CSS handling to follow changes in backend, moved CSS file to /static with splitted files
Goffi <goffi@goffi.org>
parents: 0
diff changeset
29 {% for css_file in css_files %}
164
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
30 <link rel='stylesheet' type="text/css" href='{{css_file}}'>
1
b13a26d55c64 base: updated CSS handling to follow changes in backend, moved CSS file to /static with splitted files
Goffi <goffi@goffi.org>
parents: 0
diff changeset
31 {% endfor %}
164
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
32 {% if css_files_noscript %}
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
33 <noscript>
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
34 {% for css_file in css_files_noscript %}
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
35 <link rel='stylesheet' type="text/css" href='{{css_file}}'>
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
36 {% endfor %}
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
37 </noscript>
e9f0a4215e46 multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents: 147
diff changeset
38 {% endif %}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
39 {% endif %}
26
d782227c088d base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents: 25
diff changeset
40
190
cda2aad3eed0 base: "links" template variable can now be used:
Goffi <goffi@goffi.org>
parents: 183
diff changeset
41 {% if links is defined %}
cda2aad3eed0 base: "links" template variable can now be used:
Goffi <goffi@goffi.org>
parents: 183
diff changeset
42 {% for link_data in links %}
cda2aad3eed0 base: "links" template variable can now be used:
Goffi <goffi@goffi.org>
parents: 183
diff changeset
43 <link{{link_data|xmlattr}}>
cda2aad3eed0 base: "links" template variable can now be used:
Goffi <goffi@goffi.org>
parents: 183
diff changeset
44 {% endfor %}
cda2aad3eed0 base: "links" template variable can now be used:
Goffi <goffi@goffi.org>
parents: 183
diff changeset
45 {% endif %}
cda2aad3eed0 base: "links" template variable can now be used:
Goffi <goffi@goffi.org>
parents: 183
diff changeset
46
125
04609722add0 base: add a XMPP uri <link> if xmpp_uri is set
Goffi <goffi@goffi.org>
parents: 105
diff changeset
47 {% if xmpp_uri is defined %}
04609722add0 base: add a XMPP uri <link> if xmpp_uri is set
Goffi <goffi@goffi.org>
parents: 105
diff changeset
48 <link rel="alternate" type="application/atom+xml" href="{{xmpp_uri}}" >
04609722add0 base: add a XMPP uri <link> if xmpp_uri is set
Goffi <goffi@goffi.org>
parents: 105
diff changeset
49 {% endif %}
04609722add0 base: add a XMPP uri <link> if xmpp_uri is set
Goffi <goffi@goffi.org>
parents: 105
diff changeset
50
103
ff7bd09911f7 base: replaced background_image by a way to add dynamic style
Goffi <goffi@goffi.org>
parents: 94
diff changeset
51 {% if dynamic_style is defined %}
ff7bd09911f7 base: replaced background_image by a way to add dynamic style
Goffi <goffi@goffi.org>
parents: 94
diff changeset
52 {# be extra careful about dynamic style, insure escaping if you use untrusted values ! #}
19
422c54e0204a event: adaptation to changes in backend/Libervia + background_image can now be specified in template data
Goffi <goffi@goffi.org>
parents: 9
diff changeset
53 <style type="text/css">
103
ff7bd09911f7 base: replaced background_image by a way to add dynamic style
Goffi <goffi@goffi.org>
parents: 94
diff changeset
54 {{dynamic_style}}
19
422c54e0204a event: adaptation to changes in backend/Libervia + background_image can now be specified in template data
Goffi <goffi@goffi.org>
parents: 9
diff changeset
55 </style>
422c54e0204a event: adaptation to changes in backend/Libervia + background_image can now be specified in template data
Goffi <goffi@goffi.org>
parents: 9
diff changeset
56 {% endif %}
26
d782227c088d base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents: 25
diff changeset
57
84
b2ef34e602cf base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents: 82
diff changeset
58 {# JS handling #}
b2ef34e602cf base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents: 82
diff changeset
59 {% if websocket is defined %}
b2ef34e602cf base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents: 82
diff changeset
60 {{ script.include('websocket', '') }}
b2ef34e602cf base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents: 82
diff changeset
61 {% endif %}
166
178f55b825b7 small refactoring/redesign, better BEM integration:
Goffi <goffi@goffi.org>
parents: 165
diff changeset
62 {# FIXME: following ugly hack is temporarily needed for dom_update, until a proper way to handle gettext dynamicly is implemented #}
178f55b825b7 small refactoring/redesign, better BEM integration:
Goffi <goffi@goffi.org>
parents: 165
diff changeset
63 <script>expand_txt="{% trans %}Click to expand…{% endtrans %}"; reduce_txt="{% trans %}Click to reduce…{% endtrans %}";</script>
26
d782227c088d base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents: 25
diff changeset
64 {{ script.generate_scripts() }}
84
b2ef34e602cf base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents: 82
diff changeset
65 {% if websocket is defined %}
b2ef34e602cf base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents: 82
diff changeset
66 <script>var socket=new WSHandler("{{websocket.url}}", "{{websocket.token}}", {{websocket.debug}});</script>
b2ef34e602cf base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents: 82
diff changeset
67 {% endif %}
94
304cbb690f15 base: added favicon
Goffi <goffi@goffi.org>
parents: 84
diff changeset
68
304cbb690f15 base: added favicon
Goffi <goffi@goffi.org>
parents: 84
diff changeset
69 {% block favicon %}
304cbb690f15 base: added favicon
Goffi <goffi@goffi.org>
parents: 84
diff changeset
70 <link rel="icon" href="{{media_path}}icons/apps/64/sat.png">
304cbb690f15 base: added favicon
Goffi <goffi@goffi.org>
parents: 84
diff changeset
71 {% endblock favicon %}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
72 </head>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
73 <body>
165
9e8d9d754337 base/base.html: don't show menu if main_menu is defined but none or empty
Goffi <goffi@goffi.org>
parents: 164
diff changeset
74 {% if main_menu %}
66
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
75 {% block main_menu %}
183
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
76 {% call component.menu(main_menu, class="main_menu") %}
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
77 <form action="" method="get" class="menu__language">
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
78 <select name="{{C.KEY_LANG}}" id="{{C.KEY_LANG}}" onchange="this.form.submit()">
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
79 {% if locales|length>1 %}
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
80 {% for l in locales %}
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
81 <option value="{{l}}" {{"selected" if l==locale}}>
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
82 {{l.language_name}}
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
83 </option>
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
84 {% endfor %}
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
85 {% endif %}
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
86 </select>
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
87 <button type="submit" class="menu__language-btn">
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
88 {% trans %}change{% endtrans %}
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
89 </button>
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
90 </form>
240bbac435f4 base: implemented language button:
Goffi <goffi@goffi.org>
parents: 166
diff changeset
91 {% endcall %}
66
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
92 {% endblock main_menu %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
93 {% endif %}
61
f76ec90e0e1e base: menus handling, first draft:
Goffi <goffi@goffi.org>
parents: 48
diff changeset
94
70
90a303a14112 base: use <main> for main area, for better semantic.
Goffi <goffi@goffi.org>
parents: 66
diff changeset
95 <main id='main_area'>
66
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
96 <header>
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
97 {% if confirm %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
98 {# confirmation message used when post data has been handled correctly #}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
99 {% block confirm %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
100 <div class="box post_confirm">
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
101 {% block confirm_message %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
102 {% trans %}Your data has been sent correctly.{% endtrans %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
103 {% endblock confirm_message %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
104 </div>
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
105 {% endblock confirm %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
106 {% endif %}
48
37fd11d71233 base: confirmation message can now be customised using "confirm" blog
Goffi <goffi@goffi.org>
parents: 39
diff changeset
107
66
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
108 </header>
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
109
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
110 <div id="body">
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
111 {% block category_menu scoped %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
112 {% if category_menu is defined %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
113 {{ component.menu(category_menu, class="category_menu") }}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
114 {% endif %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
115 {% endblock category_menu %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
116 {% block body %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
117 {% endblock body %}
9834106678da base: menu implementation:
Goffi <goffi@goffi.org>
parents: 61
diff changeset
118 </div>
166
178f55b825b7 small refactoring/redesign, better BEM integration:
Goffi <goffi@goffi.org>
parents: 165
diff changeset
119 <footer class="page__footer">{% block footer %}<span>{% trans app_name=C.APP_NAME %}Powered by {{app_name}}{% endtrans %}</span>{% endblock %}</footer>
70
90a303a14112 base: use <main> for main area, for better semantic.
Goffi <goffi@goffi.org>
parents: 66
diff changeset
120 </main>
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
121 </body>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
122 </html>