{% load timeslots %} {% 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 %} {# 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 #}
{{ timeslot.show.name }}
{{ default_show.name }}
{% else %} {# the days ends with this show #}
{{ timeslot.show.name }}
{% endif %} {% else %}
{{ timeslot.show.name }}
{% 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 %}