diff options
author | Christian Pointner <equinox@helsinki.at> | 2021-02-26 18:28:04 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2021-02-26 18:28:04 (GMT) |
commit | 850f92794a2571f44fd95f53a3f96f5ea659b3a4 (patch) | |
tree | a3bf8df502fbc4326e91ed7884ce8958175d7a7c /program/views.py | |
parent | 3f935fe643fd8d4f807803c99dbd25d048acb143 (diff) |
initial cleanup of V2 templates
Diffstat (limited to 'program/views.py')
-rw-r--r-- | program/views.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/program/views.py b/program/views.py index ab7bd82..2a7609c 100644 --- a/program/views.py +++ b/program/views.py @@ -259,8 +259,26 @@ class RecommendationsListViewV2(ListView): start__range=(now, end))).order_by('start')[:20] -class RecommendationsBoxViewV2(RecommendationsListView): - template_name = 'v2/boxes/recommendation.html' +class RecommendationsBoxViewV2(RecommendationsListViewV2): + template_name = 'v2/recommendation.html' + + +class CurrentShowBoxViewV2(TemplateView): + context_object_name = 'recommendation_list' + template_name = 'v2/current_show.html' + + def get_context_data(self, **kwargs): + current_timeslot = TimeSlot.objects.get_or_create_current() + previous_timeslot = current_timeslot.get_previous_by_start() + next_timeslot = current_timeslot.get_next_by_start() + after_next_timeslot = next_timeslot.get_next_by_start() + + context = super(CurrentShowBoxViewV2, self).get_context_data(**kwargs) + context['current_timeslot'] = current_timeslot + context['previous_timeslot'] = previous_timeslot + context['next_timeslot'] = next_timeslot + context['after_next_timeslot'] = after_next_timeslot + return context class DayScheduleViewV2(TemplateView): @@ -305,24 +323,6 @@ class DayScheduleViewV2(TemplateView): return context -class CurrentShowBoxViewV2(TemplateView): - context_object_name = 'recommendation_list' - template_name = 'v2/boxes/current.html' - - def get_context_data(self, **kwargs): - current_timeslot = TimeSlot.objects.get_or_create_current() - previous_timeslot = current_timeslot.get_previous_by_start() - next_timeslot = current_timeslot.get_next_by_start() - after_next_timeslot = next_timeslot.get_next_by_start() - - context = super(CurrentShowBoxViewV2, self).get_context_data(**kwargs) - context['current_timeslot'] = current_timeslot - context['previous_timeslot'] = previous_timeslot - context['next_timeslot'] = next_timeslot - context['after_next_timeslot'] = after_next_timeslot - return context - - # Exports def json_day_schedule(request, year=None, month=None, day=None): |