{# Every element of the lesson #} {% for lesson in lessons %}

{% if lesson.is_hol %} {#

{ element_container.element.holiday_reason }}

span class="badge new blue darken-2">Schulfrei#} {% elif lesson.substitution %} {# SUBSTITUTION #} {% if type == 1 and lesson.is_old %} {# When it's the old room, let it empty #} {% elif lesson.substitution.table.badge %} {# When a badge (cancellation, etc.) exists, then display it with the teacher#} {# Class or room > Display teacher #} {% if type == 2 or type == 1 %} {% if lesson.element.teacher %} {{ lesson.element.teacher.shortcode }}
{% endif %} {% endif %} {# Badge #} {{ lesson.substitution.table.badge }} {% else %} {# Display sub #} {% with sub=lesson.substitution.table %} {# Teacher or room > display classes #} {% if type == 0 or type == 1 %} {{ lesson.substitution.table.classes }} {% endif %} {# Display teacher with tooltip #} {% include "timetable/subs/teacher.html" %} {# Display subject #} {% include "timetable/subs/subject.html" %} {# Teacher or class > display room #} {% if type == 0 or type == 2 %} {% include "timetable/subs/room.html" %} {% endif %} {% endwith %} {% endif %} {# When it isn't a room or the old plan, then display the extra text (e. g. work orders) AND NOT A EVENT#} {% if not lesson.substitution.table.is_event %} {% if not type == 1 or not lesson.is_old %}
{{ lesson.substitution.table.text|default:"" }} {% endif %} {% endif %} {# Display the extra text for events #} {% if lesson.substitution.table.is_event %} {% if type == 0 and lesson.substitution.table.classes == "" and lesson.substitution.table.rooms|length == 0 and lesson.substitutions.table.teachers|length == 0 %} {{ lesson.substitution.table.text|default:"" }} {% elif type == 2 and lesson.substitution.table.teachers|length == 0 and lesson.substitution.table.rooms|length == 0 %} {{ lesson.substitution.table.text|default:"" }} {% elif type == 1 and lesson.substitution.table.teachers|length == 0 and lesson.substitution.table.classes == "" %} {{ lesson.substitution.table.text|default:"" }} {% else %}
{{ lesson.substitution.table.text|default:"" }} {% endif %} {% endif %} {% else %} {# Normal plan #} {# Teacher or room > Display classes #} {% if type == 0 or type == 1 %} {# {{ element_container.element.classes }}#} {% if lesson.element.classes %} {{ lesson.classes_formatted }} {% endif %} {% endif %} {# Class or room > Display teacher #} {% if type == 2 or type == 1 %} {% if lesson.element.teacher %} {{ lesson.element.teacher.shortcode }} {% endif %} {% endif %} {# Display subject #} {{ lesson.element.subject.shortcode }} {# Teacher or class > Display room #} {% if type == 0 or type == 2 %} {% if lesson.room %} {{ lesson.room.shortcode }} {% endif %} {% endif %} {% endif %}

{% endfor %}