summaryrefslogtreecommitdiff
path: root/program/templatetags
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-04-15 18:41:03 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-04-15 18:41:03 (GMT)
commit17f110df8c14ea258d9227d08471a4a82bfa4657 (patch)
treef2aaf3e4bbf132fa3d0fbbbafca88a420f8225a7 /program/templatetags
parent1d521e1c65babb8412b4959bd476596e0aa36aa6 (diff)
parent179a462bf561dc0cb4d19133e7e3684055278296 (diff)
merged master into stable after new deployment
Diffstat (limited to 'program/templatetags')
-rw-r--r--program/templatetags/content_boxes.py16
-rw-r--r--program/templatetags/timeslots.py13
2 files changed, 16 insertions, 13 deletions
diff --git a/program/templatetags/content_boxes.py b/program/templatetags/content_boxes.py
index b56f0d2..7f176c6 100644
--- a/program/templatetags/content_boxes.py
+++ b/program/templatetags/content_boxes.py
@@ -5,22 +5,22 @@ register = template.Library()
from program.models import BroadcastFormat, MusicFocus, ShowInformation, ShowTopic
+
@register.inclusion_tag('boxes/broadcastformat.html')
def broadcastformat():
- broadcastformats = BroadcastFormat.objects.filter(enabled=True)
- return {'broadcastformats': broadcastformats}
+ return {'broadcastformat_list': BroadcastFormat.objects.filter(enabled=True)}
+
@register.inclusion_tag('boxes/musicfocus.html')
def musicfocus():
- musicfoci = MusicFocus.objects.all()
- return {'musicfoci': musicfoci}
+ return {'musicfocus_list': MusicFocus.objects.all()}
+
@register.inclusion_tag('boxes/showinformation.html')
def showinformation():
- showinformations = ShowInformation.objects.all()
- return {'showinformations': showinformations}
+ return {'showinformation_list': ShowInformation.objects.all()}
+
@register.inclusion_tag('boxes/showtopic.html')
def showtopic():
- showtopics = ShowTopic.objects.all()
- return {'showtopics': showtopics}
+ return {'showtopic_list': ShowTopic.objects.all()}
diff --git a/program/templatetags/timeslots.py b/program/templatetags/timeslots.py
index 902de36..c2c44b5 100644
--- a/program/templatetags/timeslots.py
+++ b/program/templatetags/timeslots.py
@@ -4,19 +4,22 @@ register = template.Library()
from datetime import datetime, time, timedelta
+
@register.simple_tag
def duration(start, end):
return 'style="height: %dpx"' % ((end-start).seconds/60)
+
@register.simple_tag
def duration_until(end):
- start = datetime.combine(end.date(), time(6,0))
+ start = datetime.combine(end.date(), time(6, 0))
return 'style="height: %dpx"' % ((end-start).seconds/60)
+
@register.simple_tag
def duration_since(start):
- if start.time() < time(23,59):
- end = datetime.combine(start.date()+timedelta(days=1), time(6,0))
+ if start.time() < time(23, 59):
+ end = datetime.combine(start.date()+timedelta(days=1), time(6, 0))
else:
- end = datetime.combine(start.date(), time(6,0))
- return 'style="height: %dpx"' % ((end-start).seconds/60) \ No newline at end of file
+ end = datetime.combine(start.date(), time(6, 0))
+ return 'style="height: %dpx"' % ((end-start).seconds/60)