{# Every element of the lesson #} {% for element_container in col.elements %}

{% if element_container.substitution %} {# SUBSTITUTION #} {% if type == 1 and element_container.is_old %} {# When it's the old room, let it empty #} {% elif element_container.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 %} {{ element_container.element.teacher.shortcode }}
{% endif %} {# Badge #} {{ element_container.substitution.table.badge }} {% else %} {# Display sub #} {# Teacher or room > display classes #} {% if type == 0 or type == 1 %} {{ element_container.substitution.table.classes }} {% endif %} {# Display teacher with tooltip #} {{ element_container.substitution.table.teacher|safe }} {# Display subject #} {{ element_container.substitution.table.subject|safe }} {# Teacher or class > display room #} {% if type == 0 or type == 2 %} {{ element_container.substitution.table.room|safe }} {% endif %} {% endif %}
{# When it isn't a room or the old plan, then display the extra text (e. g. work orders)#} {% if not type == 1 or not element_container.is_old %} {{ element_container.substitution.table.text|default:"" }} {% endif %} {% else %} {# Normal plan #} {# Teacher or room > Display classes #} {% if type == 0 or type == 1 %} {# {{ element_container.element.classes }}#} {% if element_container.element.classes %} {{ element_container.classes_formatted }} {% endif %} {% endif %} {# Class or room > Display teacher #} {% if type == 2 or type == 1 %} {{ element_container.element.teacher.shortcode }} {% endif %} {# Display subject #} {{ element_container.element.subject.shortcode }} {# Teacher or class > Display room #} {% if type == 0 or type == 2 %} {% if element_container.room %} {{ element_container.room.shortcode }} {% endif %} {% endif %} {% endif %}

{% endfor %}