From c895afbebf5fc32b6ce94a258fc2c3cd34ffa1de Mon Sep 17 00:00:00 2001 From: Ernesto Rico-Schmidt Date: Fri, 15 Aug 2014 20:35:42 +0200 Subject: simplified and fixed week schedule diff --git a/program/templates/week_schedule_timeslot.html b/program/templates/week_schedule_timeslot.html index 852466b..f1f6918 100644 --- a/program/templates/week_schedule_timeslot.html +++ b/program/templates/week_schedule_timeslot.html @@ -1,54 +1,51 @@ {% 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" %} -
-
{{ timeslot.show.name }}
-
-{% endif %} - -{% if forloop.first and timeslot.start != "06:00" and timeslot.show == default_show %} -
-
{{ timeslot.show.name }}
-
-{% endif %} - -{% if forloop.first and timeslot.start != "06:00" and timeslot.show != default_show %} -
-
{{ timeslot.show.name }}
-
-{% endif %} - -{% if not forloop.first and not forloop.last %} -
-
{{ timeslot.show.name }}
-
+{% if forloop.first %} + {% if timeslot.start.hour < 6 %} + {# the day starts with the first show until its end #} +
+
{{ timeslot.show.name }}
+
+ {% else %} + {# the day starts with a default show until the start of first show #} +
+
{{ default_show.name }}
+
+
+
{{ timeslot.show.name }}
+
+ {% endif %} {% if timeslot.end != timeslot.get_next_by_start.start %} -
-
{{ default_show.name }}
+ {# a default show is needed to fill the time until the next show #} +
+
{{ default_show.name }}
+
+ {% endif %} +{% elif forloop.last %} + {% if timeslot.end.hour < 6 %} + {# the day ends with this show and a default show until 6 #} + +
+
{{ default_show.name }}
+
+ {% else %} + {# the days ends with this show #} + + {% endif %} +{% else %} + + {% if timeslot.end != timeslot.get_next_by_start.start %} + {# a default show is needed to fill the time until the next show #} +
+
{{ 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 %} -- cgit v0.10.2