changeset 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 7108731be0b9
children b12de12e2e5b
files default/base/base.html
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
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 %}