changeset 942:6b55d038b121

pages (g/e): adapted event handling to changes in backend
author Goffi <goffi@goffi.org>
date Fri, 19 May 2017 12:57:53 +0200
parents aba7208d9d50
children aacda981c348
files src/pages/g/e/page_meta.py
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/pages/g/e/page_meta.py	Fri May 19 12:56:47 2017 +0200
+++ b/src/pages/g/e/page_meta.py	Fri May 19 12:57:53 2017 +0200
@@ -35,9 +35,22 @@
 
     event_service = template_data[u'event_service'] = jid.JID(event_uri_data[u'path'])
     event_node = template_data[u'event_node'] = event_uri_data[u'node']
+    event_id = template_data[u'event_id'] = event_uri_data.get(u'item','')
     profile = self.getProfile(request)
-    event_data = yield self.host.bridgeCall(u"eventGet", event_service.userhost(), event_node, profile)
+    event_timestamp, event_data = yield self.host.bridgeCall(u"eventGet", event_service.userhost(), event_node, event_id, profile)
+    try:
+        background_image = event_data.pop('background-image')
+    except KeyError:
+        pass
+    else:
+        template_data['background_image'] = background_image
     template_data['event'] = event_data
+    event_invitee_data = yield self.host.bridgeCall(
+        u"eventInviteeGet",
+        event_data['invitees_service'],
+        event_data['invitees_node'],
+        profile)
+    template_data['invitee'] = event_invitee_data
 
     ## Blog ##
 
@@ -64,6 +77,6 @@
         service, node, attend, guests = self.getPostedData(request, (u'service', u'node', u'attend', u'guests'))
         data = {u'attend': attend,
                 u'guests': guests}
-        yield self.host.bridgeCall(u"eventSet", service, node, data, profile)
+        yield self.host.bridgeCall(u"eventInviteeSet", service, node, data, profile)
     else:
         log.warning(_(u"Unhandled data type: {}").format(type_))