From 0dd0d9c44722f4d4b16fe5654c634b5ac2337f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Zapke-Gru=CC=88ndemann?= Date: Fri, 6 Jan 2012 09:28:13 +0100 Subject: Added view for all events. CSS needs some love. --- .../templates/calendarium/list_events.html | 20 ++++++++++++++++++++ sublab_project/calendarium/urls.py | 6 ++++++ sublab_project/calendarium/views.py | 14 +++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 sublab_project/calendarium/templates/calendarium/list_events.html create mode 100644 sublab_project/calendarium/urls.py (limited to 'sublab_project/calendarium') diff --git a/sublab_project/calendarium/templates/calendarium/list_events.html b/sublab_project/calendarium/templates/calendarium/list_events.html new file mode 100644 index 0000000..6e0b4d4 --- /dev/null +++ b/sublab_project/calendarium/templates/calendarium/list_events.html @@ -0,0 +1,20 @@ +{% extends 'base.html' %} + +{% block title %}Termine{% endblock %} + +{%block content %} +

Termine

+

Hier findest du Veranstaltungen, die im sublab und dessen Umgebung stattfinden.

+

Veranstaltungen im sublab

+ +

Was sonst noch los ist

+ +{% endblock content %} diff --git a/sublab_project/calendarium/urls.py b/sublab_project/calendarium/urls.py new file mode 100644 index 0000000..002e1e2 --- /dev/null +++ b/sublab_project/calendarium/urls.py @@ -0,0 +1,6 @@ +from django.conf.urls.defaults import patterns, include, url + + +urlpatterns = patterns('calendarium.views', + url('^$', 'list_events', name='calendarium_list_events'), +) diff --git a/sublab_project/calendarium/views.py b/sublab_project/calendarium/views.py index 60f00ef..4b11c7b 100644 --- a/sublab_project/calendarium/views.py +++ b/sublab_project/calendarium/views.py @@ -1 +1,13 @@ -# Create your views here. +from django.shortcuts import render + +from models import Event + + +def list_events(request): + """Displays all events grouped by source. + """ + context = { + 'events_source_import': Event.objects.filter(source=Event.SOURCE_IMPORT), + 'events_source_admin': Event.objects.filter(source=Event.SOURCE_ADMIN), + } + return render(request, 'calendarium/list_events.html', context) -- cgit v1.2.1