Mercurial > libervia-templates
annotate default/base/base.html @ 78:d1741c2f3e9d
js(common): renamed css.js to common.js has it will have generic functions not only for css manipulation.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 23 Dec 2017 21:37:08 +0100 |
parents | 9471c7309ecc |
children | 6ba0129a9a4e |
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 %} |
78
d1741c2f3e9d
js(common): renamed css.js to common.js has it will have generic functions not only for css manipulation.
Goffi <goffi@goffi.org>
parents:
75
diff
changeset
|
3 {{ script.include('common') }} {# common.js has many useful functions, so we 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> | |
20 {% 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
|
21 {% 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
|
22 <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
|
23 {% endfor %} |
0 | 24 {% endif %} |
26
d782227c088d
base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents:
25
diff
changeset
|
25 |
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
|
26 {% 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
|
27 {# 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
|
28 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
|
29 <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
|
30 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
|
31 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
|
32 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
|
33 } |
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
|
34 </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
|
35 {% endif %} |
26
d782227c088d
base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents:
25
diff
changeset
|
36 |
d782227c088d
base/base.html: generate <script> element and include css.js by default
Goffi <goffi@goffi.org>
parents:
25
diff
changeset
|
37 {{ script.generate_scripts() }} |
0 | 38 </head> |
39 <body> | |
66 | 40 {% if main_menu is defined %} |
41 {% block main_menu %} | |
42 {{ component.menu(main_menu, class="main_menu") }} | |
43 {% endblock main_menu %} | |
44 {% endif %} | |
61 | 45 |
70
90a303a14112
base: use <main> for main area, for better semantic.
Goffi <goffi@goffi.org>
parents:
66
diff
changeset
|
46 <main id='main_area'> |
66 | 47 <header> |
48 {% if confirm %} | |
49 {# confirmation message used when post data has been handled correctly #} | |
50 {% block confirm %} | |
51 <div class="box post_confirm"> | |
52 {% block confirm_message %} | |
53 {% trans %}Your data has been sent correctly.{% endtrans %} | |
54 {% endblock confirm_message %} | |
55 </div> | |
56 {% endblock confirm %} | |
57 {% endif %} | |
48
37fd11d71233
base: confirmation message can now be customised using "confirm" blog
Goffi <goffi@goffi.org>
parents:
39
diff
changeset
|
58 |
66 | 59 </header> |
60 | |
61 <div id="body"> | |
62 {% block category_menu scoped %} | |
63 {% if category_menu is defined %} | |
64 {{ component.menu(category_menu, class="category_menu") }} | |
65 {% endif %} | |
66 {% endblock category_menu %} | |
67 {% block body %} | |
68 {% endblock body %} | |
69 </div> | |
70 <footer>{% block footer %}{% trans app_name=C.APP_NAME %}Powered by {{app_name}}{% endtrans %}{% endblock %}</footer> | |
70
90a303a14112
base: use <main> for main area, for better semantic.
Goffi <goffi@goffi.org>
parents:
66
diff
changeset
|
71 </main> |
0 | 72 </body> |
73 </html> |