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