From 943ce9db0959edee22dcdc6f613421862e345216 Mon Sep 17 00:00:00 2001 From: Ernesto Rico Schmidt Date: Thu, 23 Jan 2020 23:53:48 -0400 Subject: more height to display the 5 min slot at 12 pm beginning next week diff --git a/program/templates/week_schedule.html b/program/templates/week_schedule.html index ad6b012..d64a0d3 100644 --- a/program/templates/week_schedule.html +++ b/program/templates/week_schedule.html @@ -25,7 +25,12 @@
09:00
10:00
11:00
+ {% if current_year == '2020' and current_week >= '05' %} +
12:00
+
12:05
+ {% else %}
12:00
+ {% endif %}
13:00
14:00
15:00
@@ -101,7 +106,12 @@
09:00
10:00
11:00
+ {% if current_year == '2020' and current_week >= '05' %} +
12:00
+
12:05
+ {% else %}
12:00
+ {% endif %}
13:00
14:00
15:00
diff --git a/program/templates/week_schedule_timeslot.html b/program/templates/week_schedule_timeslot.html index a96f2bb..532f750 100644 --- a/program/templates/week_schedule_timeslot.html +++ b/program/templates/week_schedule_timeslot.html @@ -1,61 +1,61 @@ {% load timeslots %} {% if forloop.first and timeslot.start != timeslot.get_previous_by_start.end %} -
+
{{ default_show.name }}
{% endif %} {% if forloop.first and timeslot.start == timeslot.get_next_by_start.end and timeslot.start != "06:00" %} -
+ {% endif %} {% if forloop.first and timeslot.start != "06:00" and timeslot.show == default_show %} -
+ {% endif %} {% if forloop.first and timeslot.start != "06:00" and timeslot.show != default_show %} -
+ {% endif %} {% if forloop.first and timeslot.end != timeslot.get_next_by_start.start %} -
+
{{ default_show.name }}
{% endif %} {% if not forloop.first and not forloop.last %} -
+ {% if timeslot.end != timeslot.get_next_by_start.start %} -
+
{{ default_show.name }}
{% endif %} {% endif %} {% if forloop.last and timeslot.end != "06:00" and timeslot.show == default_show %} -
+ {% endif %} {% if forloop.last and timeslot.end != "06:00" and timeslot.show != default_show %} -
+ {% endif %} {% if forloop.last and timeslot.end != timeslot.get_next_by_start.start %} -
+
{{ default_show.name }}
{% endif %} diff --git a/program/templatetags/timeslots.py b/program/templatetags/timeslots.py index 08e45b1..9b6712a 100644 --- a/program/templatetags/timeslots.py +++ b/program/templatetags/timeslots.py @@ -6,20 +6,23 @@ register = template.Library() @register.simple_tag -def duration(start, end): - return 'style="height: %dpx"' % ((end-start).seconds/60) +def height(start, end): + if start.year == 2020 and int(start.strftime('%V')) >= 5 and start.hour == 12 and start.minute == 0: + return '30' + else: + return '%d' % ((end - start).seconds / 60) @register.simple_tag -def duration_until(end): +def height_until(end): start = datetime.combine(end.date(), time(6, 0)) - return 'style="height: %dpx"' % ((end-start).seconds/60) + return '%d' % ((end - start).seconds / 60) @register.simple_tag -def duration_since(start): +def height_since(start): if start.time() < time(23, 59): - end = datetime.combine(start.date()+timedelta(days=1), time(6, 0)) + 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) + return '%d' % ((end - start).seconds / 60) -- cgit v0.10.2