changeset 946:d076b722ca52

pages (g/e): added days left before the event as a template variable
author Goffi <goffi@goffi.org>
date Sun, 21 May 2017 16:00:55 +0200
parents 44dde9b955e8
children 92f0eeb6dc72
files src/pages/g/e/page_meta.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/pages/g/e/page_meta.py	Sun May 21 16:00:29 2017 +0200
+++ b/src/pages/g/e/page_meta.py	Sun May 21 16:00:55 2017 +0200
@@ -7,6 +7,7 @@
 from twisted.words.protocols.jabber import jid
 from libervia.server import session_iface
 from sat.tools.common import uri
+import time
 from sat.core.log import getLogger
 log = getLogger('pages/g/e')
 
@@ -50,6 +51,7 @@
         event_data['invitees_node'],
         profile)
     template_data['invitee'] = event_invitee_data
+    template_data['days_left'] = int((event_timestamp - time.time()) / (60 * 60 * 24))
 
     ## Blog ##