diff --git a/nasg.py b/nasg.py index 6649264..54da21a 100644 --- a/nasg.py +++ b/nasg.py @@ -510,6 +510,20 @@ class Singular(MarkdownDoc): else: return False + @property + def event(self): + if 'event' not in self.meta: + return False + + event = self.meta.get('event', {}) + event.update({ + 'startdate': arrow.get(event.get('start')).format(settings.dateformat.get('display')), + 'starttime': arrow.get(event.get('start')).format(settings.dateformat.get('iso')), + 'enddate': arrow.get(event.get('end')).format(settings.dateformat.get('display')), + 'endtime': arrow.get(event.get('end')).format(settings.dateformat.get('iso')), + }) + return event + @cached_property def tmplvars(self): v = { @@ -532,6 +546,7 @@ class Singular(MarkdownDoc): 'url': self.url, 'review': self.review, 'has_code': self.has_code, + 'event': self.event, } if (self.is_photo): v.update({ diff --git a/templates/base.j2.html b/templates/base.j2.html index 4ac49b6..0225c52 100644 --- a/templates/base.j2.html +++ b/templates/base.j2.html @@ -105,8 +105,13 @@ {% block content %} +{% if post.event %} + {% set mftype = 'h-entry h-event' %} +{% else %} + {% set mftype = 'h-entry' %} +{% endif %}
-
+

{% if post.is_reply %} @@ -166,6 +171,24 @@