From 2a68242a5482c9898e805676bcfa8e361aceba80 Mon Sep 17 00:00:00 2001 From: Luke Hatcher Date: Thu, 20 Dec 2012 01:49:32 -0500 Subject: [PATCH] add overall conference schedule --- symposion/schedule/urls.py | 2 +- symposion/schedule/views.py | 19 ++++++++++ .../schedule/schedule_conference.html | 38 +++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 symposion/templates/schedule/schedule_conference.html diff --git a/symposion/schedule/urls.py b/symposion/schedule/urls.py index e00d61e0..9ddf1207 100644 --- a/symposion/schedule/urls.py +++ b/symposion/schedule/urls.py @@ -2,7 +2,7 @@ from django.conf.urls.defaults import url, patterns urlpatterns = patterns("symposion.schedule.views", - url(r"^$", "schedule_detail", name="schedule_detail"), + url(r"^$", "schedule_conference", name="schedule_conference"), url(r"^edit/$", "schedule_edit", name="schedule_edit"), url(r"^list/$", "schedule_list", name="schedule_list"), url(r"^presentations.csv$", "schedule_list_csv", name="schedule_list_csv"), diff --git a/symposion/schedule/views.py b/symposion/schedule/views.py index 347b6ce2..f88d01f4 100644 --- a/symposion/schedule/views.py +++ b/symposion/schedule/views.py @@ -25,6 +25,25 @@ def fetch_schedule(slug): return schedule +def schedule_conference(request): + + schedules = Schedule.objects.all() + + sections = [] + for schedule in schedules: + days_qs = Day.objects.filter(schedule=schedule) + days = [TimeTable(day) for day in days_qs] + sections.append({ + "schedule": schedule, + "days": days, + }) + + ctx = { + "sections": sections, + } + return render(request, "schedule/schedule_conference.html", ctx) + + def schedule_detail(request, slug=None): schedule = fetch_schedule(slug) diff --git a/symposion/templates/schedule/schedule_conference.html b/symposion/templates/schedule/schedule_conference.html new file mode 100644 index 00000000..fa3ca87b --- /dev/null +++ b/symposion/templates/schedule/schedule_conference.html @@ -0,0 +1,38 @@ +{% extends "site_base.html" %} + +{% load i18n %} +{% load bootstrap_tags %} +{% load boxes_tags %} +{% load cache %} + +{% block head_title %}Conference Schedule{% endblock %} + +{% block body_class %}full{% endblock %} + +{% block right %} +{% endblock %} + +{% block body_outer %} +
+
+
+

Conference Schedule

+ {% block breadcrumbs %}{% endblock %} +
+
+
+ {% box "schedule_top" %} + + {% for section in sections %} + {% cache 600 "schedule-table" section.schedule.section %} + {% for timetable in section.days %} +

{{ timetable.day.date }}

+ {% include "schedule/_grid.html" %} + {% endfor %} + {% endcache %} + {% endfor %} + + {% box "schedule_bottom" %} +
+
+{% endblock %}