diff --git a/aleksis/apps/chronos/templates/chronos/partials/lesson.html b/aleksis/apps/chronos/templates/chronos/partials/lesson.html index 0a4f681bf4946f69011ca7a87bf9a56f3d74b161..b6b2ae962b5b89accb13bba31924b9cef2071431 100644 --- a/aleksis/apps/chronos/templates/chronos/partials/lesson.html +++ b/aleksis/apps/chronos/templates/chronos/partials/lesson.html @@ -1,3 +1,5 @@ +{% 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 #} diff --git a/aleksis/apps/chronos/templates/chronos/substitutions.html b/aleksis/apps/chronos/templates/chronos/substitutions.html index cc8819aef55ac315f026afa0e9a147ed3ea6494a..a195696d52d59fdac4f67bb869db9c0fbcf13f72 100644 --- a/aleksis/apps/chronos/templates/chronos/substitutions.html +++ b/aleksis/apps/chronos/templates/chronos/substitutions.html @@ -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>