summaryrefslogtreecommitdiff
path: root/helsinki/program/templatetags/content_boxes.py
diff options
context:
space:
mode:
Diffstat (limited to 'helsinki/program/templatetags/content_boxes.py')
-rw-r--r--helsinki/program/templatetags/content_boxes.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/helsinki/program/templatetags/content_boxes.py b/helsinki/program/templatetags/content_boxes.py
new file mode 100644
index 0000000..56c0afb
--- /dev/null
+++ b/helsinki/program/templatetags/content_boxes.py
@@ -0,0 +1,30 @@
+# http://docs.djangoproject.com/en/dev/howto/custom-template-tags/
+
+from django import template
+register = template.Library()
+
+from helsinki.program.models import (
+ BroadcastFormat,
+ MusicFocus,
+ ShowInformation,
+ ShowTopic)
+
+@register.inclusion_tag('program/box_broadcastformat.html')
+def broadcastformat():
+ broadcastformats = BroadcastFormat.objects.all()
+ return {'broadcastformats': broadcastformats}
+
+@register.inclusion_tag('program/box_musicfocus.html')
+def musicfocus():
+ musicfoci = MusicFocus.objects.all()
+ return {'musicfoci': musicfoci}
+
+@register.inclusion_tag('program/box_showinformation.html')
+def showinformation():
+ showinformations = ShowInformation.objects.all()
+ return {'showinformations': showinformations}
+
+@register.inclusion_tag('program/box_showtopic.html')
+def showtopic():
+ showtopics = ShowTopic.objects.all()
+ return {'showtopics': showtopics}