Skip to content
Snippets Groups Projects
Commit b9da0796 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Remove bugs in plan | Comment

parent 5b53df82
No related branches found
No related tags found
No related merge requests found
......@@ -118,9 +118,13 @@
<div class="col s2">
<div class="card timetable-title-card">
<div class="card-content">
<span class="card-title left">
{{ time.number_format }}
</span>
{# Lesson number #}
<span class="card-title left">
{{ time.number_format }}
</span>
{# Time dimension of lesson #}
<div class="right timetable-time grey-text text-darken-2">
<span>{{ time.start|date:"H:i" }}</span><br>
<span>{{ time.end|date:"H:i" }}</span>
......@@ -130,56 +134,85 @@
</div>
{% for col in row %}
{# A lesson #}
<div class="col s2">
<div class="card lesson-card">
<div class="card-content">
{# Every element of the lesson #}
{% for element_container in col.elements %}
<div style="
{# Display background color only if no badge exists and it is not the old room #}
{% if not element_container.substitution.table.badge %}
{% if not element_container.is_old or type != 1 %}
background-color: {{ element_container.element.subject.hex_color }};
{% endif %}
{% endif %}"
{# Add CSS class for sub when it's a sub #}
class="{% if element_container.substitution %}lesson-with-sub{% endif %}">
<p>
{% 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 #}
<span class="badge new green darken-2">{{ element_container.substitution.table.badge }}</span>
{% else %}
{# Display sub #}
{# Teacher or room > display classes #}
{% if type == 0 or type == 1 %}
{{ element_container.substitution.table.classes }}
{% endif %}
{# Display teacher with tooltip #}
<span class="tooltipped" data-position="bottom"
data-tooltip="{{ element_container.substitution.table.teacher_full|safe }}">{{ element_container.substitution.table.teacher|safe }}</span>
{# Display subject #}
{{ element_container.substitution.table.subject|safe }}
{# Teacher or class > display room #}
{% if type == 0 or type == 2 %}
<span class="tooltipped" data-position="bottom"
data-tooltip="{{ element_container.substitution.table.room_full|safe }}">{{ element_container.substitution.table.room|safe }}</span>
{% endif %}
{% endif %}<br>
{% if not type == 1 and not element_container.is_old %}
{# 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 %}
<small>
<em>{{ element_container.substitution.table.text|default:"" }}</em>
</small>
{% endif %}
{% else %}
{# Normal plan #}
{# Teacher or room > Display classes #}
{% if type == 0 or type == 1 %}
{% for class in element_container.element.classes %}
{{ class.name }}
{% endfor %}
{% endif %}
{# Class or room > Display teacher #}
{% if type == 2 or type == 1 %}
<span data-position="bottom" class="tooltipped"
data-tooltip="{{ element_container.element.teacher }}">{{ element_container.element.teacher.shortcode }}</span>
{% endif %}
{# Display subject #}
<strong>{{ element_container.element.subject.shortcode }}</strong>
{# Teacher or class > Display room #}
{% if type == 0 or type == 2 %}
<span class="tooltipped" data-position="bottom"
data-tooltip="{{ element_container.room.name }}">{{ element_container.room.shortcode }}</span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment