Mercurial > libervia-web
comparison src/pages/g/e/page_meta.py @ 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 | 36e9747520fd |
children | 1c09f41e2f52 |
comparison
equal
deleted
inserted
replaced
1027:46ce20494a1b | 1028:ad97d7e7de3b |
---|---|
5 from sat.core.i18n import _ | 5 from sat.core.i18n import _ |
6 from twisted.internet import defer | 6 from twisted.internet import defer |
7 from twisted.words.protocols.jabber import jid | 7 from twisted.words.protocols.jabber import jid |
8 from libervia.server import session_iface | 8 from libervia.server import session_iface |
9 from sat.tools.common import uri | 9 from sat.tools.common import uri |
10 from sat.tools.common.template import safe | |
10 import time | 11 import time |
12 import cgi | |
11 from sat.core.log import getLogger | 13 from sat.core.log import getLogger |
12 log = getLogger('pages/g/e') | 14 log = getLogger('pages/g/e') |
13 | 15 |
14 access = C.PAGES_ACCESS_PROFILE | 16 access = C.PAGES_ACCESS_PROFILE |
15 template = u"event/invitation.html" | 17 template = u"event/invitation.html" |
41 try: | 43 try: |
42 background_image = event_data.pop('background-image') | 44 background_image = event_data.pop('background-image') |
43 except KeyError: | 45 except KeyError: |
44 pass | 46 pass |
45 else: | 47 else: |
46 template_data['background_image'] = background_image | 48 template_data['dynamic_style'] = safe(u""" |
49 html { | |
50 background-image: url("%s"); | |
51 background-size: 15em; | |
52 } | |
53 """ % cgi.escape(background_image, True)) | |
47 template_data['event'] = event_data | 54 template_data['event'] = event_data |
48 event_invitee_data = yield self.host.bridgeCall( | 55 event_invitee_data = yield self.host.bridgeCall( |
49 u"eventInviteeGet", | 56 u"eventInviteeGet", |
50 event_data['invitees_service'], | 57 event_data['invitees_service'], |
51 event_data['invitees_node'], | 58 event_data['invitees_node'], |