diff options
author | Markus Zapke-Grùˆndemann <markus@keimlink.de> | 2012-01-24 03:28:17 +0100 |
---|---|---|
committer | Markus Zapke-Grùˆndemann <markus@keimlink.de> | 2012-01-24 03:28:17 +0100 |
commit | 97ca77af739b5ecb87b3ec29462bed549fc47d27 (patch) | |
tree | 103c91b13d1bf6b642663046b5f00e3e9771d07f /sublab_project/calendarium | |
parent | 3f56ff5bfb09f3cf071d023bab97f606d385a637 (diff) | |
parent | 48b4ce88c6940eb76a20c2df7acbc0b1200b3984 (diff) |
Merge branch 'master' of sublab.org:subweb
Diffstat (limited to 'sublab_project/calendarium')
-rw-r--r-- | sublab_project/calendarium/tasks.py | 3 | ||||
-rw-r--r-- | sublab_project/calendarium/templates/calendarium/list_events.html | 28 |
2 files changed, 24 insertions, 7 deletions
diff --git a/sublab_project/calendarium/tasks.py b/sublab_project/calendarium/tasks.py index ee35e45..d0ab16d 100644 --- a/sublab_project/calendarium/tasks.py +++ b/sublab_project/calendarium/tasks.py @@ -46,7 +46,8 @@ class CalendariumImport(PeriodicTask): event_info = {} for fieldinfo in event_fields: try: - event_info[fieldinfo[0]] = str(event[fieldinfo[1]]) + event_info[fieldinfo[0]] = event[fieldinfo[1]].format().encode("utf-8") + event_info[fieldinfo[0]] = event_info[fieldinfo[0]].decode("string-escape") except KeyError: event_info[fieldinfo[0]] = fieldinfo[2] start = icalendar.vDatetime.from_ical(event['dtstart'].ical()) diff --git a/sublab_project/calendarium/templates/calendarium/list_events.html b/sublab_project/calendarium/templates/calendarium/list_events.html index 6e0b4d4..4ccecfc 100644 --- a/sublab_project/calendarium/templates/calendarium/list_events.html +++ b/sublab_project/calendarium/templates/calendarium/list_events.html @@ -1,20 +1,36 @@ {% extends 'base.html' %} {% block title %}Termine{% endblock %} +{% block header %} +<script src="{{ STATIC_URL }}js/jquery-1.7.1.js" type="text/javascript" charset="utf-8"></script> +<script type="text/javascript"> +<!-- +$(document).ready(function() { + $(".events h4").click(function() { + $(this).next().toggle('medium'); + }).next().hide(); +}); +--> +</script> +{% endblock %} {%block content %} <h2>Termine</h2> <p>Hier findest du Veranstaltungen, die im sublab und dessen Umgebung stattfinden.</p> <h3>Veranstaltungen im sublab</h3> - <ul class="events"> + <div class="events"> {% for event in events_source_import %} - <li>{{ event.start|date:"l, j. F Y H:i" }} bis {{ event.end|date:"H:i" }} Uhr - {{ event.name }}<br/>{{ event.description }}</li> + <h4>{{ event.start|date:"l, j. F Y H:i" }} bis {{ event.end|date:"H:i" }} Uhr: {{ event.name }}</h4> + <p class="description">{{ event.description }}</p> {% endfor %} - </ul> + </div> + {% if events_source_admin %} <h3>Was sonst noch los ist</h3> - <ul class="events"> + <div class="events"> {% for event in events_source_admin %} - <li>{{ event.start|date:"l, j. F Y H:i" }} bis {{ event.end|date:"l, j. F Y H:i" }} Uhr - {{ event.name }}<br/>{{ event.description }}</li> + <h4>{{ event.start|date:"l, j. F Y H:i" }} bis {{ event.end|date:"l, j. F Y H:i" }} Uhr: {{ event.name }}</h4> + <p class="description">{{ event.description }}</p> {% endfor %} - </ul> + </div> + {% endif %} {% endblock content %} |