Mercurial > libervia-templates
annotate sat_templates/templates/default/base/base.html @ 165:9e8d9d754337
base/base.html: don't show menu if main_menu is defined but none or empty
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 14 Sep 2018 19:49:15 +0200 |
parents | e9f0a4215e46 |
children | 178f55b825b7 |
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 | 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 #} |
0 | 4 <!DOCTYPE html> |
5 <html> | |
6 <head> | |
75 | 7 <meta charset="utf-8"> |
8 <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
|
9 |
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 {% 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
|
11 <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
|
12 {% 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
|
13 |
0 | 14 <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
|
15 |
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
|
16 {% if css_content is defined %} |
0 | 17 <style type="text/css"> |
18 {{css_content}} | |
19 </style> | |
164
e9f0a4215e46
multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
20 {% 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
|
21 <noscript> |
e9f0a4215e46
multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
22 <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
|
23 {{css_content_noscript}} |
e9f0a4215e46
multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
24 </style> |
e9f0a4215e46
multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
25 </noscript> |
e9f0a4215e46
multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
26 {% endif %} |
0 | 27 {% 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
|
28 {% 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
|
29 <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
|
30 {% endfor %} |
164
e9f0a4215e46
multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
31 {% 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
|
32 <noscript> |
e9f0a4215e46
multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
33 {% 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
|
34 <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
|
35 {% endfor %} |
e9f0a4215e46
multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
36 </noscript> |
e9f0a4215e46
multi-sites handling (moved templates to "templates" sub-directory) + noscript styles handling.
Goffi <goffi@goffi.org>
parents:
147
diff
changeset
|
37 {% endif %} |
0 | 38 {% endif %} |
26
d782227c088d
base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents:
25
diff
changeset
|
39 |
125
04609722add0
base: add a XMPP uri <link> if xmpp_uri is set
Goffi <goffi@goffi.org>
parents:
105
diff
changeset
|
40 {% 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
|
41 <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
|
42 {% endif %} |
04609722add0
base: add a XMPP uri <link> if xmpp_uri is set
Goffi <goffi@goffi.org>
parents:
105
diff
changeset
|
43 |
103
ff7bd09911f7
base: replaced background_image by a way to add dynamic style
Goffi <goffi@goffi.org>
parents:
94
diff
changeset
|
44 {% 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
|
45 {# 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
|
46 <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
|
47 {{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
|
48 </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
|
49 {% endif %} |
26
d782227c088d
base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents:
25
diff
changeset
|
50 |
84
b2ef34e602cf
base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents:
82
diff
changeset
|
51 {# JS handling #} |
b2ef34e602cf
base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents:
82
diff
changeset
|
52 {% if websocket is defined %} |
b2ef34e602cf
base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents:
82
diff
changeset
|
53 {{ script.include('websocket', '') }} |
b2ef34e602cf
base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents:
82
diff
changeset
|
54 {% endif %} |
26
d782227c088d
base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents:
25
diff
changeset
|
55 {{ script.generate_scripts() }} |
84
b2ef34e602cf
base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents:
82
diff
changeset
|
56 {% if websocket is defined %} |
b2ef34e602cf
base, js (websocket), css (main style): dynamic pages implementation, first draft:
Goffi <goffi@goffi.org>
parents:
82
diff
changeset
|
57 <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
|
58 {% endif %} |
94 | 59 |
60 {% block favicon %} | |
61 <link rel="icon" href="{{media_path}}icons/apps/64/sat.png"> | |
62 {% endblock favicon %} | |
0 | 63 </head> |
64 <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
|
65 {% if main_menu %} |
66 | 66 {% block main_menu %} |
67 {{ component.menu(main_menu, class="main_menu") }} | |
68 {% endblock main_menu %} | |
69 {% endif %} | |
61 | 70 |
70
90a303a14112
base: use <main> for main area, for better semantic.
Goffi <goffi@goffi.org>
parents:
66
diff
changeset
|
71 <main id='main_area'> |
66 | 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 %} | |
48
37fd11d71233
base: confirmation message can now be customised using "confirm" blog
Goffi <goffi@goffi.org>
parents:
39
diff
changeset
|
83 |
66 | 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> | |
105
490114e3d9e2
css (blog): set background to footer to make it visible is an image is in background
Goffi <goffi@goffi.org>
parents:
103
diff
changeset
|
95 <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
|
96 </main> |
0 | 97 </body> |
98 </html> |