{% extends "base.html" %} {% block content %}
{% if user %}

personalisierter Drehplan für {{ user.realname }}

{% else %}

Drehplan

{% endif %}
{% if user %} {{ "<<" }} {{ ">>" }} today {% else %} {{ "<<" }} {{ ">>" }} today {% endif %}
{% for d in days if (d.index < 5) or (d.lectures|length) > 0 %}{% endfor %} {# iterating over each 15 min block #} {% for t in times %} {% set time_index = loop.index %} {# display time in first row if its a full hour #} {% if ((time_index - 1) is divisibleby 4) %} {{ t.strftime("%H:%M") }}{% endif %} {# iterate over days if if it is a working day or we have lectures on that day (optionaly skip weekends) #} {% for d in days if (d.index < 5) or (d.lectures|length) > 0 %} {% for col in range(1,d.maxcol+1) %} {# iterate over all lextures but only consider those that are in the current column and happen in the 15 min block #} {# time_index starts at 0 so we use it directly and do not do +1 #} {% for l in d.lectures|selectattr('timetable_col','equalto',col) if ((l.time.time() >= t) and (l.time.time() < times[time_index])) %} {# handle the first column of a day specialy, set red background if hidden #} {% else %} {# if the lecture is in the current collumn but not the current time slot #} {% for l in d.lectures|selectattr('timetable_col','equalto',col) if (l.time.time() < t) and (l.time_end.time() > t) %} {# this part is covered by another lecture using rowspan #} {% else %} {# no lecture right now, just end column #} {% endfor %} {% endfor %} {# end lecture #} {% endfor %} {# end day column #} {% endfor %} {# end day #} {% endfor %} {# end 15 min block #}
{{ d.date.strftime("%A (%d.%m.%Y)") }}
{# print the lecture block #}

{{l.course.short}} {{l.course.short}}
{{l.time.strftime("%H:%M")}} - {{l.time_end.strftime("%H:%M")}}
{{l.place}}

{% endblock %}