changeset 26:d782227c088d

base/base.html: generate <script> element and include css.js by default
author Goffi <goffi@goffi.org>
date Sat, 24 Jun 2017 20:22:36 +0200
parents b046a7835374
children 38328c57f3ef
files default/base/base.html
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/default/base/base.html	Sat Jun 24 20:20:51 2017 +0200
+++ b/default/base/base.html	Sat Jun 24 20:22:36 2017 +0200
@@ -1,4 +1,5 @@
 {% set embedded = True %} {# embedded is set to avoid including base.html several times if a generic page is included (e.g. blog/articles.html) #}
+{{ script.include('css') }} {# css.js is a common script, so it's useful to import it here #}
 <!DOCTYPE html>
 <html>
 <head>
@@ -9,6 +10,7 @@
     {% endif %}
 
     <title>{% block title %}{{C.APP_NAME}}{% endblock %}</title>
+
     {% if css_content is defined %}
         <style type="text/css">
             {{css_content}}
@@ -18,6 +20,7 @@
             <link rel='stylesheet' type="text/css" href='{{root_path}}{{css_file}}'>
         {% endfor %}
     {% endif %}
+
     {% if background_image is defined %}
         {# Q&D workaround to implement dynamic background-image
            it should be replaced by a better mechanism in the future, avoid using it #}
@@ -28,6 +31,8 @@
             }
         </style>
     {% endif %}
+
+    {{ script.generate_scripts() }}
 </head>
 <body>
     <div id="body">