From c5cc5086d00786cfb8696655ffbd95922dc5d68c Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Mon, 4 Apr 2016 11:04:38 -0300 Subject: Include onetime events in head --- template/calendar.j2 | 15 +-------------- template/calendar_event.j2 | 14 ++++++++++++++ template/calendar_head.j2 | 10 ++++++++++ 3 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 template/calendar_event.j2 create mode 100644 template/calendar_head.j2 (limited to 'template') diff --git a/template/calendar.j2 b/template/calendar.j2 index ea851a2..f69018c 100644 --- a/template/calendar.j2 +++ b/template/calendar.j2 @@ -1,18 +1,5 @@
{%- for event in events %} - {%- if event.recurring %} -

- {%- else %} -

- {%- endif -%} - - {%- if event.multiday %} - {{- event.start.strftime('%A, %d. %B %Y').decode('utf-8') }} - {{ event.end.strftime('%A, %d. %B %Y').decode('utf-8') }} - {%- else %}{{ event.start.strftime('%A, %d. %B %Y, %H:%M Uhr').decode('utf-8') }} - {%- endif -%} - {{ event.name }}

-
-

{{ event.description|default('Keine Beschreibung',true) }}

-
+ {% include 'calendar_event.j2' %} {%- endfor %}
diff --git a/template/calendar_event.j2 b/template/calendar_event.j2 new file mode 100644 index 0000000..106b65a --- /dev/null +++ b/template/calendar_event.j2 @@ -0,0 +1,14 @@ +{%- if event.recurring %} +

+{%- else %} +

+{%- endif -%} + + {%- if event.multiday %} + {{- event.start.strftime('%A, %d. %B %Y').decode('utf-8') }} - {{ event.end.strftime('%A, %d. %B %Y').decode('utf-8') }} + {%- else %}{{ event.start.strftime('%A, %d. %B %Y, %H:%M Uhr').decode('utf-8') }} + {%- endif -%} + {{ event.name }}

+
+

{{ event.description|default('Keine Beschreibung',true) }}

+
diff --git a/template/calendar_head.j2 b/template/calendar_head.j2 new file mode 100644 index 0000000..d8df951 --- /dev/null +++ b/template/calendar_head.j2 @@ -0,0 +1,10 @@ +
+{%- for event in events[:7] %} + {% include 'calendar_event.j2' %} +{%- endfor %} +{%- for event in events[7:] %} + {% if not event.recurring %} + {% include 'calendar_event.j2' %} + {% endif %} +{%- endfor %} +
-- cgit v1.2.1