diff --git a/program/models.py b/program/models.py index 0a26d075..1cf91f08 100644 --- a/program/models.py +++ b/program/models.py @@ -102,7 +102,7 @@ class Speaker(CreatedUpdatedModel): ordering = ['name'] def __unicode__(self): - return self.name + return '%s (%s)' % (self.name, self.camp) def save(self, **kwargs): if not self.slug: diff --git a/program/templates/program_base.html b/program/templates/program_base.html index 36a4fead..a223c3bf 100644 --- a/program/templates/program_base.html +++ b/program/templates/program_base.html @@ -1,28 +1,49 @@ {% extends 'schedule_base.html' %} {% block schedule_content %} +
+
+ Overview + {% for day in camp.camp_days %} + {% with day.lower.date|date:"m" as month_padded %} + {% with day.lower.date|date:"d" as day_padded %} + + {{ day.lower.date|date:"l" }} + + {% endwith %} + {% endwith %} + {% endfor %} +
+
-Overview -{% for day in camp.camp_days %} - {% with day.lower.date|date:"m" as month_padded %} - {% with day.lower.date|date:"d" as day_padded %} - - {{ day.lower.date|date:"l" }} - - {% endwith %} - {% endwith %} -{% endfor %} +

-


+
+
- - All - -{% for event_type in camp.event_types %} - - {{ event_type.name }} - -{% endfor %} + {% if not urlyear %} + + {% if eventtype %}All{% else %}All{% endif %} + + {% else %} + + {% if eventtype %}All{% else %}All{% endif %} + + {% endif %} + + {% for event_type in camp.event_types %} + {% if not urlyear %} + + {% if eventtype and eventtype == event_type %}{{ event_type.name }}{% else %}{{ event_type.name }}{% endif %} + + {% else %} + + {% if eventtype and eventtype == event_type %}{{ event_type.name }}{% else %}{{ event_type.name }}{% endif %} + + {% endif %} + {% endfor %} +
+

diff --git a/program/templates/schedule_base.html b/program/templates/schedule_base.html index 79b90e76..380f4e71 100644 --- a/program/templates/schedule_base.html +++ b/program/templates/schedule_base.html @@ -2,17 +2,15 @@ {% block content %} -
- +
+
+ Schedule + Call for Speakers + Speakers + Talks & Events +
+

- Schedule - Call for Speakers - Speakers - Talks & Events -

- -
- {% block schedule_content %} {% endblock schedule_content %} diff --git a/program/views.py b/program/views.py index 082cb352..dafb4694 100644 --- a/program/views.py +++ b/program/views.py @@ -87,9 +87,19 @@ class ProgramDayView(CampViewMixin, TemplateView): timeslots.append(timeslot) context['timeslots'] = timeslots + # include the components to make the urls + context['urlyear'] = self.kwargs['year'] + context['urlmonth'] = self.kwargs['month'] + context['urlday'] = self.kwargs['day'] + + if 'type' in self.request.GET: + context['eventtype'] = models.EventType.objects.get(slug=self.request.GET['type']) + + print dir(self.request.resolver_match.func.view_class) return context + class EventDetailView(CampViewMixin, DetailView): model = models.Event template_name = 'program_event_detail.html' diff --git a/templates/base.html b/templates/base.html index cd6d8863..005ceedf 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,5 +1,6 @@ {% load static from staticfiles %} {% load bootstrap3 %} +{% load menubutton %} {% static "" as baseurl %} @@ -33,13 +34,13 @@ {% if request.resolver_match.kwargs.camp_slug %} - + {% else %} {% endif %} - - +
{% if camp %}
-

-

+

+

{% endif %} {% bootstrap_messages %} {% block content %}{% endblock %} @@ -93,3 +94,4 @@ {% bootstrap_javascript jquery=1 %} + diff --git a/utils/templatetags/menubutton.py b/utils/templatetags/menubutton.py new file mode 100644 index 00000000..72fa4986 --- /dev/null +++ b/utils/templatetags/menubutton.py @@ -0,0 +1,12 @@ +import datetime +from django import template + +register = template.Library() + +@register.simple_tag(takes_context=True) +def menubuttonclass(context, appname): + if appname == context['request'].resolver_match.func.view_class.__module__.split(".")[0]: + return "btn-primary" + else: + return "btn-default" +