changeset 1028:ad97d7e7de3b

pages (g/e): replaced background_image by new dynamic_style template variable
author Goffi <goffi@goffi.org>
date Mon, 22 Jan 2018 08:53:06 +0100
parents 46ce20494a1b
children 78b7b5ec7ca1
files src/pages/g/e/page_meta.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/pages/g/e/page_meta.py	Mon Jan 22 08:53:03 2018 +0100
+++ b/src/pages/g/e/page_meta.py	Mon Jan 22 08:53:06 2018 +0100
@@ -7,7 +7,9 @@
 from twisted.words.protocols.jabber import jid
 from libervia.server import session_iface
 from sat.tools.common import uri
+from sat.tools.common.template import safe
 import time
+import cgi
 from sat.core.log import getLogger
 log = getLogger('pages/g/e')
 
@@ -43,7 +45,12 @@
     except KeyError:
         pass
     else:
-        template_data['background_image'] = background_image
+        template_data['dynamic_style'] = safe(u"""
+            html {
+                background-image: url("%s");
+                background-size: 15em;
+            }
+            """ % cgi.escape(background_image, True))
     template_data['event'] = event_data
     event_invitee_data = yield self.host.bridgeCall(
         u"eventInviteeGet",