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/templatetags | |
parent | 3f935fe643fd8d4f807803c99dbd25d048acb143 (diff) |
initial cleanup of V2 templates
Diffstat (limited to 'program/templatetags')
-rw-r--r-- | program/templatetags/content_boxes.py | 29 | ||||
-rw-r--r-- | program/templatetags/filters.py | 30 |
2 files changed, 30 insertions, 29 deletions
diff --git a/program/templatetags/content_boxes.py b/program/templatetags/content_boxes.py index f979ca2..ece466b 100644 --- a/program/templatetags/content_boxes.py +++ b/program/templatetags/content_boxes.py @@ -5,8 +5,6 @@ from program.models import BroadcastFormat, MusicFocus, ShowInformation, ShowTop register = template.Library() -# Legacy Tags for Homepage until 2021 - @register.inclusion_tag('boxes/broadcastformat.html') def broadcastformat(): return {'broadcastformat_list': BroadcastFormat.objects.filter(enabled=True)} @@ -30,30 +28,3 @@ def showtopic(): @register.inclusion_tag('boxes/language.html') def language(): return {'language_list': Language.objects.all()} - - -# V2 Tags added for new Homepage 2021 - -@register.inclusion_tag('v2/boxes/broadcastformat.html') -def broadcastformatV2(): - return {'broadcastformat_list': BroadcastFormat.objects.filter(enabled=True)} - - -@register.inclusion_tag('v2/boxes/musicfocus.html') -def musicfocusV2(): - return {'musicfocus_list': MusicFocus.objects.all()} - - -@register.inclusion_tag('v2/boxes/showinformation.html') -def showinformationV2(): - return {'showinformation_list': ShowInformation.objects.all()} - - -@register.inclusion_tag('v2/boxes/showtopic.html') -def showtopicV2(): - return {'showtopic_list': ShowTopic.objects.all()} - - -@register.inclusion_tag('v2/boxes/language.html') -def languageV2(): - return {'language_list': Language.objects.all()} diff --git a/program/templatetags/filters.py b/program/templatetags/filters.py new file mode 100644 index 0000000..811216b --- /dev/null +++ b/program/templatetags/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()} |