comparison 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
comparison
equal deleted inserted replaced
102:7108731be0b9 103:ff7bd09911f7
21 {% for css_file in css_files %} 21 {% for css_file in css_files %}
22 <link rel='stylesheet' type="text/css" href='{{root_path}}{{css_file}}'> 22 <link rel='stylesheet' type="text/css" href='{{root_path}}{{css_file}}'>
23 {% endfor %} 23 {% endfor %}
24 {% endif %} 24 {% endif %}
25 25
26 {% if background_image is defined %} 26 {% if dynamic_style is defined %}
27 {# Q&D workaround to implement dynamic background-image 27 {# be extra careful about dynamic style, insure escaping if you use untrusted values ! #}
28 it should be replaced by a better mechanism in the future, avoid using it #}
29 <style type="text/css"> 28 <style type="text/css">
30 html { 29 {{dynamic_style}}
31 background-image: url('{{background_image}}');
32 background-size: 15em;
33 }
34 </style> 30 </style>
35 {% endif %} 31 {% endif %}
36 32
37 {# JS handling #} 33 {# JS handling #}
38 {% if websocket is defined %} 34 {% if websocket is defined %}