diff --git a/aleksis/apps/alsijil/templates/alsijil/partials/register_coursebook.html b/aleksis/apps/alsijil/templates/alsijil/partials/register_coursebook.html index 7931a9675631bbaff3099b32d1e9dd85db6aa5df..9dccecfd61b0a13f0ea9e4b71510e57f9af81612 100644 --- a/aleksis/apps/alsijil/templates/alsijil/partials/register_coursebook.html +++ b/aleksis/apps/alsijil/templates/alsijil/partials/register_coursebook.html @@ -1,6 +1,4 @@ -{% for day, documentations in documentations_by_day %} - <h4>{% trans 'Week' %} {{ week.week }}: {{ week.0 }}–{{ week.6 }}</h4> - +<h4>{% trans 'Coursebook' %}</h4> <table class="small-print"> <thead> <tr> @@ -14,101 +12,95 @@ </tr> </thead> <tbody> - {% for day in week %} - {% with register_objects_by_day|get_dict:day as register_objects %} - {% for register_object, documentation, notes, substitution in register_objects %} - <tr class=" - {% if substitution %} - {% if substitution.cancelled %} - lesson-cancelled - {% else %} - lesson-substituted - {% endif %} + {% for day, documentations in documentations_by_day %} + <!-- CONTINUE --> + <!-- Update next row --> + {% for register_object, documentation, notes, substitution in register_objects %} + <tr class=" + {% if doc.amends %} + {% if doc.amends.cancelled %} + lesson-cancelled {% endif %} - {% if forloop.first %} - lessons-day-first + {% if doc.amends.amends %} + lesson-substituted {% endif %} - "> - {% if forloop.first %} - <th rowspan="{{ register_objects|length }}" class="lessons-day-head">{{ day|date:"D" }}</th> - {% endif %} - <td class="lesson-pe"> - {% if register_object.label_ != "event" %} - {{ register_object.period.period }} + {% endif %} + {% if forloop.first %} + lessons-day-first + {% endif %} + "> + {% if forloop.first %} + <!-- TODO: There is no lessons-day-head class --> + <th rowspan="{{ documentations|length }}" class="lessons-day-head">{{ day|date:"D" }}</th> + {% endif %} + <td class="lesson-pe"> + {% if doc.amends %} + {% if doc.amends.slot_number_start == doc.amends.slot_number_ends %} + {{ doc.amends.slot_number_start }}. {% else %} - {{ register_object.period_from_on_day }}.–{{ register_object.period_to_on_day }}. + {{ doc.amends.slot_number_start }}.–{{ doc.amends.slot_number_end }}. {% endif %} - </td> - <td class="lesson-subj"> - {% if register_object.label_ == "event" %} - <strong>{% trans "Event" %}</strong> - {% elif substitution %} - {% include "chronos/partials/subs/subject.html" with type="substitution" el=substitution %} - {% else %} - {% include "chronos/partials/subject.html" with subject=register_object.get_subject %} + {% else %} + {{ doc.datetime_start|time:"H:i" }}-{{ doc.datetime_end|time:"H:i" }} + {% endif %} + </td> + <td class="lesson-subj"> + {% include "chronos/partials/subject.html" with subject=doc.subject %} + </td> + <td class="lesson-topic"> + {{ doc.topic }} + </td> + <td class="lesson-homework">{{ doc.homework }}</td> + <td class="lesson-notes"> + {{ documentation.group_note }} + {% for note in notes %} + {% if note.absent %} + <span class="lesson-note-absent"> + {{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}. + {% if note.excused %} + <span class="lesson-note-excused"> + {% if note.excuse_type %} + ({{ note.excuse_type.short_name }}) + {% else %} + ({% trans 'e' %}) + {% endif %} + </span> + {% endif %} + </span> {% endif %} - </td> - <td class="lesson-topic"> - {% if register_object.label_ == "event" %} - {{ register_object.title }}: {{ documentation.topic }} - {% elif substitution.cancelled %} - {% trans 'Lesson cancelled' %} - {% else %} - {{ documentation.topic }} + {% if note.tardiness %} + <span class="lesson-note-late"> + {{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}. + ({{ note.tardiness }}′) + {% if note.excused %} + <span class="lesson-note-excused"> + {% if note.excuse_type %} + ({{ note.excuse_type.short_name }}) + {% else %} + ({% trans 'e' %}) + {% endif %} + </span> + {% endif %} + </span> {% endif %} - </td> - <td class="lesson-homework">{{ documentation.homework }}</td> - <td class="lesson-notes"> - {{ documentation.group_note }} - {% for note in notes %} - {% if note.absent %} - <span class="lesson-note-absent"> - {{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}. - {% if note.excused %} - <span class="lesson-note-excused"> - {% if note.excuse_type %} - ({{ note.excuse_type.short_name }}) - {% else %} - ({% trans 'e' %}) - {% endif %} - </span> - {% endif %} - </span> - {% endif %} - {% if note.tardiness %} - <span class="lesson-note-late"> - {{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}. - ({{ note.tardiness }}′) - {% if note.excused %} - <span class="lesson-note-excused"> - {% if note.excuse_type %} - ({{ note.excuse_type.short_name }}) - {% else %} - ({% trans 'e' %}) - {% endif %} - </span> - {% endif %} - </span> - {% endif %} - {% for extra_mark in note.extra_marks.all %} - <span> - {{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}. - ({{ extra_mark.short_name }}) - </span> - {% endfor %} + {% for extra_mark in note.extra_marks.all %} + <span> + {{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}. + ({{ extra_mark.short_name }}) + </span> {% endfor %} - </td> - <td class="lesson-te"> - {% if documentation.topic %} - {{ register_object.get_teachers.first.short_name }} - {% endif %} - </td> - </tr> - {% endfor %} - {% endwith %} - {% endfor %} - </tbody> - </table> + {% endfor %} + </td> + <td class="lesson-te"> + {% if documentation.topic %} + {{ register_object.get_teachers.first.short_name }} + {% endif %} + </td> + </tr> + {% endfor %} + {% endwith %} + {% endfor %} + </tbody> +</table> - <div class="page-break"> </div> -{% endfor %} +<div class="page-break"> </div>