From 59be96ee97d08017bd3ba37b77fc5a3442262909 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 3 Mar 2021 14:43:22 +0100 Subject: move show filters to seperate endpoint diff --git a/program/templates/v2/day_schedule.html b/program/templates/v2/day_schedule.html index e91c020..8fef31d 100644 --- a/program/templates/v2/day_schedule.html +++ b/program/templates/v2/day_schedule.html @@ -4,15 +4,6 @@ -{% load filters %} -
-{% broadcastformatV2 %} -{% musicfocusV2 %} -{% showinformationV2 %} -{% showtopicV2 %} -{% languageV2 %} -
-

Tagesansicht

{{ day|date:"l, d.m.Y" }}

diff --git a/program/templates/v2/host_list.html b/program/templates/v2/host_list.html index 27b2895..3d4663d 100644 --- a/program/templates/v2/host_list.html +++ b/program/templates/v2/host_list.html @@ -4,7 +4,7 @@ -
+

Sendungsmachende A-Z

{% for host in host_list %} diff --git a/program/templates/v2/show_detail.html b/program/templates/v2/show_detail.html index 5e687f1..56f1a84 100644 --- a/program/templates/v2/show_detail.html +++ b/program/templates/v2/show_detail.html @@ -4,8 +4,6 @@ -
-
diff --git a/program/templates/v2/show_filters.html b/program/templates/v2/show_filters.html new file mode 100644 index 0000000..16f6a0a --- /dev/null +++ b/program/templates/v2/show_filters.html @@ -0,0 +1,17 @@ + + + Show Filters + + + +{% load show_filters %} +
+{% broadcastformatV2 %} +{% musicfocusV2 %} +{% showinformationV2 %} +{% showtopicV2 %} +{% languageV2 %} +
+ + + diff --git a/program/templates/v2/show_list.html b/program/templates/v2/show_list.html index b88695f..56ecd21 100644 --- a/program/templates/v2/show_list.html +++ b/program/templates/v2/show_list.html @@ -4,15 +4,6 @@ -{% load filters %} -
-{% broadcastformatV2 %} -{% musicfocusV2 %} -{% showinformationV2 %} -{% showtopicV2 %} -{% languageV2 %} -
-

Sendungen A-Z

diff --git a/program/templatetags/filters.py b/program/templatetags/filters.py deleted file mode 100644 index 811216b..0000000 --- a/program/templatetags/filters.py +++ /dev/null @@ -1,30 +0,0 @@ -from django import template - -from program.models import BroadcastFormat, MusicFocus, ShowInformation, ShowTopic, Language - -register = template.Library() - - -@register.inclusion_tag('v2/filters/broadcastformat.html') -def broadcastformatV2(): - return {'broadcastformat_list': BroadcastFormat.objects.filter(enabled=True)} - - -@register.inclusion_tag('v2/filters/musicfocus.html') -def musicfocusV2(): - return {'musicfocus_list': MusicFocus.objects.all()} - - -@register.inclusion_tag('v2/filters/showinformation.html') -def showinformationV2(): - return {'showinformation_list': ShowInformation.objects.all()} - - -@register.inclusion_tag('v2/filters/showtopic.html') -def showtopicV2(): - return {'showtopic_list': ShowTopic.objects.all()} - - -@register.inclusion_tag('v2/filters/language.html') -def languageV2(): - return {'language_list': Language.objects.all()} diff --git a/program/templatetags/show_filters.py b/program/templatetags/show_filters.py new file mode 100644 index 0000000..811216b --- /dev/null +++ b/program/templatetags/show_filters.py @@ -0,0 +1,30 @@ +from django import template + +from program.models import BroadcastFormat, MusicFocus, ShowInformation, ShowTopic, Language + +register = template.Library() + + +@register.inclusion_tag('v2/filters/broadcastformat.html') +def broadcastformatV2(): + return {'broadcastformat_list': BroadcastFormat.objects.filter(enabled=True)} + + +@register.inclusion_tag('v2/filters/musicfocus.html') +def musicfocusV2(): + return {'musicfocus_list': MusicFocus.objects.all()} + + +@register.inclusion_tag('v2/filters/showinformation.html') +def showinformationV2(): + return {'showinformation_list': ShowInformation.objects.all()} + + +@register.inclusion_tag('v2/filters/showtopic.html') +def showtopicV2(): + return {'showtopic_list': ShowTopic.objects.all()} + + +@register.inclusion_tag('v2/filters/language.html') +def languageV2(): + return {'language_list': Language.objects.all()} diff --git a/program/urls.py b/program/urls.py index a4909e4..776b9c0 100644 --- a/program/urls.py +++ b/program/urls.py @@ -31,6 +31,7 @@ urlpatterns = patterns('', url(r'^v2/shows/?$', views.ShowListViewV2.as_view()), url(r'^v2/shows/(?P[\w-]+)/?$', views.ShowDetailViewV2.as_view()), url(r'^v2/(?P\d+)/?$', views.TimeSlotDetailViewV2.as_view()), + url(r'^v2/show-filters/?$', views.ShowFilterListViewV2.as_view()), ) if settings.DEBUG: urlpatterns += \ diff --git a/program/views.py b/program/views.py index 61a6207..3f1cf9e 100644 --- a/program/views.py +++ b/program/views.py @@ -301,6 +301,10 @@ class DayScheduleViewV2(TemplateView): return context +class ShowFilterListViewV2(TemplateView): + template_name = 'v2/show_filters.html' + + # Exports def json_day_schedule(request, year=None, month=None, day=None): -- cgit v0.10.2