diff default/base/base.html @ 103:ff7bd09911f7

base: replaced background_image by a way to add dynamic style
author Goffi <goffi@goffi.org>
date Mon, 22 Jan 2018 08:49:49 +0100
parents 304cbb690f15
children 490114e3d9e2
line wrap: on
line diff
--- a/default/base/base.html	Mon Jan 22 08:46:07 2018 +0100
+++ b/default/base/base.html	Mon Jan 22 08:49:49 2018 +0100
@@ -23,14 +23,10 @@
         {% 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 #}
+    {% if dynamic_style is defined %}
+    {# be extra careful about dynamic style, insure escaping if you use untrusted values ! #}
         <style type="text/css">
-            html {
-                background-image: url('{{background_image}}');
-                background-size: 15em;
-            }
+        {{dynamic_style}}
         </style>
     {% endif %}