annotate default/base/base.html @ 37:eb9a42fca6c8

input/form: added csrf_token hidden field if it is defined, and import form with context to get this variable
author Goffi <goffi@goffi.org>
date Mon, 10 Jul 2017 19:11:34 +0200
parents d782227c088d
children 9abef4a23af0
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) #}
26
d782227c088d base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents: 25
diff changeset
2 {{ script.include('css') }} {# css.js is a common script, so it's useful to import it here #}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
3 <!DOCTYPE html>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
4 <html>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
5 <head>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
6 <meta charset="utf-8" />
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
7
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
8 {% 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
9 <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
10 {% 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
11
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
12 <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
13
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
14 {% if css_content is defined %}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
15 <style type="text/css">
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
16 {{css_content}}
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
17 </style>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
18 {% 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
19 {% for css_file in css_files %}
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
20 <link rel='stylesheet' type="text/css" href='{{root_path}}{{css_file}}'>
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
21 {% endfor %}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
22 {% endif %}
26
d782227c088d base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents: 25
diff changeset
23
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
24 {% if background_image is defined %}
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
25 {# Q&D workaround to implement dynamic background-image
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
26 it should be replaced by a better mechanism in the future, avoid using it #}
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
27 <style type="text/css">
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
28 html {
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
29 background-image: url('{{background_image}}');
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
30 background-size: 15em;
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
31 }
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
32 </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
33 {% endif %}
26
d782227c088d base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents: 25
diff changeset
34
d782227c088d base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents: 25
diff changeset
35 {{ script.generate_scripts() }}
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
36 </head>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
37 <body>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
38 <div id="body">
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
39 {% block body %}
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
40 {% endblock body %}
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
41 </div>
20
8fa2fd2e928e default: added i18n support
Goffi <goffi@goffi.org>
parents: 19
diff changeset
42 <footer>{% block footer %}{% trans app_name=C.APP_NAME %}Powered by {{app_name}}{% endtrans %}{% endblock %}</footer>
0
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
43 </body>
9a31d2c02f47 SàT templates, initial commit
Goffi <goffi@goffi.org>
parents:
diff changeset
44 </html>