{% load i18n %}

{% if lesson_period.is_hol and smart %} {# Do nothing #} {% elif lesson_period.get_substitution and smart %} {% with sub=lesson_period.get_substitution %} {# SUBSTITUTION #} {% if type == "room" and lesson_period.room != lesson_period.get_room and lesson_period.get_room != el %} {# When it's the old room, let it empty #} {% elif sub.cancelled or sub.cancelled_for_teachers %} {# When a badge (cancellation, etc.) exists, then display it with the teacher#} {# Class or room > Display teacher #} {% if type == "group" or type == "room" and lesson_period.lesson.teachers.all %} {% include "chronos/partials/teachers.html" with teachers=lesson_period.lesson.teachers.all %}
{% endif %} {# Badge #} {% if sub.cancelled_for_teachers %} {% trans "Cancelled for teachers" %}{% else %}{% trans "Cancelled" %}{% endif %} {% else %} {# Display sub #} {# Teacher or room > display classes #} {% if type == "teacher" or type == "room" %} {% include "chronos/partials/groups.html" with groups=lesson_period.lesson.groups.all %} {% endif %} {# Display teacher with tooltip #} {% include "chronos/partials/subs/teachers.html" %} {# Display subject #} {% include "chronos/partials/subs/subject.html" %} {# Teacher or class > display room #} {% if type == "teacher" or type == "group" %} {% include "chronos/partials/subs/room.html" %} {% endif %} {% endif %} {# When it isn't a room or the old plan, then display the extra text (e. g. work orders) #} {% if not lesson_period.room == lesson_period.get_room and lesson_period.get_room != el and sub.comment %}
{{ lesson_period.get_substitution.comment }} {% endif %} {# Display the extra text for events #} {# {% if lesson_period.substitution.table.is_event %}#} {# {% if type == 0 and lesson_period.substitution.table.classes == "" and lesson_period.substitution.table.rooms|length == 0 and lesson_period.substitutions.table.teachers|length == 0 %}#} {# {{ lesson_period.substitution.table.text|default:"" }}#} {# {% elif type == 2 and lesson_period.substitution.table.teachers|length == 0 and lesson_period.substitution.table.rooms|length == 0 %}#} {# {{ lesson_period.substitution.table.text|default:"" }}#} {# {% elif type == 1 and lesson_period.substitution.table.teachers|length == 0 and lesson_period.substitution.table.classes == "" %}#} {# {{ lesson_period.substitution.table.text|default:"" }}#} {# {% else %}#} {#
#} {# #} {# {{ lesson_period.substitution.table.text|default:"" }}#} {# #} {# {% endif %}#} {# {% endif %}#} {% endwith %} {% else %} {# Normal plan #} {# Teacher or room > Display classes #} {% if type == "teacher" or type == "room" %} {# {{ element_container.element.classes }}#} {% if lesson_period.lesson.groups %} {% include "chronos/partials/groups.html" with groups=lesson_period.lesson.groups.all %} {% endif %} {% endif %} {# Class or room > Display teacher #} {% if type == "room" or type == "group" %} {% include "chronos/partials/teachers.html" with teachers=lesson_period.lesson.teachers.all %} {% endif %} {# Display subject #} {{ lesson_period.lesson.subject.abbrev }} {# Teacher or class > Display room #} {% if type == "teacher" or type == "group" %} {% if lesson_period.room %} {{ lesson_period.room.short_name }} {% endif %} {% endif %} {% endif %}