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

Fix use of badges for status "Cancelled"

parent 0815bb8e
No related branches found
No related tags found
1 merge request!31Biscuit merge. Closes #53.
{% load i18n %}
<div class="card lesson-card">
<div class="card-content">
......@@ -30,16 +32,16 @@
{% if type == "room" and lesson_period.room != lesson_period.get_room %}
{# When it's the old room, let it empty #}
{% elif lesson_period.substitution.table.badge %}
{% elif lesson_period.get_substitution.cancelled %}
{# When a badge (cancellation, etc.) exists, then display it with the teacher#}
{# Class or room > Display teacher #}
{% if type == "group" or type == "room" %}
{% include "chronos/partials/teachers.html" with teachers=lesson_period.lesson.teachers.all %}
{% if type == "group" or type == "room" and lesson_period.lesson.teachers.all %}
{% include "chronos/partials/teachers.html" with teachers=lesson_period.lesson.teachers.all %}<br/>
{% endif %}
{# Badge #}
<span class="badge new green darken-2">{{ lesson_period.substitution.table.badge }}</span>
<span class="badge new green darken-2">{% trans "Cancelled" %}</span>
{% else %}
{# Display sub #}
......
......@@ -96,14 +96,15 @@
{% include "chronos/partials/subs/room.html" %}
</td>
<td>
{% if sub.badge %}
<span class="badge new green hide-on-med-and-up">{{ sub.badge }}</span>
{% if sub.cancelled %}
{# TODO: Support other cases#}
<span class="badge new green hide-on-med-and-up">{% trans "Cancelled" %}</span>
{% endif %}
<em>{{ sub.text|default:"" }}</em>
</td>
<td class="hide-on-small-and-down">
{% if sub.badge %}
<span class="badge new green darken-2">{{ sub.badge }}</span>
{% if sub.cancelled %}
<span class="badge new green darken-2">{% trans "Cancelled" %}</span>
{% endif %}
</td>
</tr>
......
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