diff options
-rw-r--r-- | public/css/sublab.calendar.css | 7 | ||||
-rw-r--r-- | public/js/calendar.js | 3 | ||||
-rw-r--r-- | scripts/calendar_plugin2.py | 2 | ||||
-rw-r--r-- | template/tabcalendar_list.j2 | 13 |
4 files changed, 20 insertions, 5 deletions
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 @@ +<div class="tabcalendar-details"> +{%- for event in events %} +<div class="tabcalendar-event-details" id="{{event.id}}"> +<p><span class="date"> + {%- 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 -%} + </span> <span class="name">{{ event.name }}</span></p> +<p>{{ event.description|default('Keine Beschreibung', true) }}</p> +</div> +{%- endfor %} +</div> |