From 6fb1deda0d09fa1be55888e878e6cacef0da1b65 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Tue, 5 Apr 2016 14:48:03 -0300 Subject: Use different template to render tabcalendar --- public/css/sublab.calendar.css | 7 ++++++- public/js/calendar.js | 3 --- scripts/calendar_plugin2.py | 2 +- template/tabcalendar_list.j2 | 13 +++++++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 template/tabcalendar_list.j2 diff --git a/public/css/sublab.calendar.css b/public/css/sublab.calendar.css index bb59a18..5e3b15e 100644 --- a/public/css/sublab.calendar.css +++ b/public/css/sublab.calendar.css @@ -47,7 +47,6 @@ border-right: 1px solid #1c1e22 ! important; border-bottom: 1px solid #1c1e22 ! important; } - .tabcal-day { text-align: right; } @@ -70,3 +69,9 @@ .tabcal-cell>ul>li { padding-left: 4px; } +.tabcalendar-event-details .name { + font-weight: bold; +} +.tabcalendar-event-details .date { + font-size: 0.8em; +} diff --git a/public/js/calendar.js b/public/js/calendar.js index d3313af..2f402ae 100644 --- a/public/js/calendar.js +++ b/public/js/calendar.js @@ -1,7 +1,4 @@ $(function() { - cal_list = $('.calendar-listing'); - if (cal_list.length && cal_list[0].classList.contains('expanded')) - return; $('.calendar-listing>p').click(function() { $(this).next().toggle('fast'); return false; diff --git a/scripts/calendar_plugin2.py b/scripts/calendar_plugin2.py index fd6d1df..62a68aa 100644 --- a/scripts/calendar_plugin2.py +++ b/scripts/calendar_plugin2.py @@ -105,7 +105,7 @@ class TabularCalendarPlugin: }).encode('utf-8') def _get_calendar_events(self): - return self.template_env.get_template('calendar.j2').render({ + return self.template_env.get_template('tabcalendar_list.j2').render({ 'months': self.months, 'events': self.events, 'class': 'expanded' diff --git a/template/tabcalendar_list.j2 b/template/tabcalendar_list.j2 new file mode 100644 index 0000000..02d7c2b --- /dev/null +++ b/template/tabcalendar_list.j2 @@ -0,0 +1,13 @@ +
+{%- for event in events %} +
+

+ {%- 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) }}

+
+{%- endfor %} +
-- cgit v1.2.1