Skip to content
Snippets Groups Projects
Commit 4fa766a9 authored by permcu's avatar permcu
Browse files

Tidy the coursebook-template

parent 5061222c
No related branches found
No related tags found
1 merge request!422Resolve "Add export functionality to course book"
<h4>{% trans 'Coursebook' %}</h4>
<table class="small-print">
<thead>
<tr>
<th></th>
<th>{% trans 'Pe.' %}</th>
<th>{% trans 'Subj.' %}</th>
<th>{% trans 'Lesson topic' %}</th>
<th>{% trans 'Homework' %}</th>
<th>{% trans 'Notes' %}</th>
<th>{% trans 'Te.' %}</th>
</tr>
</thead>
<tbody>
<table class="small-print">
<thead>
<tr>
<th></th>
<th>{% trans 'Pe.' %}</th>
<th>{% trans 'Subj.' %}</th>
<th>{% trans 'Lesson topic' %}</th>
<th>{% trans 'Homework' %}</th>
<th>{% trans 'Notes' %}</th>
<th>{% trans 'Te.' %}</th>
</tr>
</thead>
<tbody>
{% 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 doc.amends.amends %}
lesson-substituted
{% endif %}
<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 %}
<!-- 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 %}
{{ doc.amends.slot_number_start }}.–{{ doc.amends.slot_number_end }}.
{% endif %}
{% else %}
{{ doc.datetime_start|time:"H:i" }}-{{ doc.datetime_end|time:"H:i" }}
{% 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 %}
{{ doc.amends.slot_number_start }}.–{{ doc.amends.slot_number_end }}.
{% endif %}
{% 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 participation in doc.notable_participations %}
{% if participation.absence_reason %}
<span class="lesson-note-absent">
{{ participation.person.short_name }}
<span class="lesson-note-excused">
({{ participation.absence_reason.short_name }})
</span>
</span>
{% 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 participation in doc.notable_participations %}
{% if participation.absence_reason %}
<span class="lesson-note-absent">
{{ participation.person.short_name }}
<span class="lesson-note-excused">
({{ participation.absence_reason.short_name }})
</span>
{% if participation.tardiness %}
<span class="lesson-note-late">
{{ participation.person.short_name }}
({{ participation.tardiness }}′)
</span>
{% endif %}
{% for personal_note in doc.personal_notes %}
{% if personal_note.extra_mark %}
<span>
{{ personal_note.person.short_name }}
({{ personal_note.extra_mark.short_name }})
</span>
{% endif %}
{% if participation.tardiness %}
<span class="lesson-note-late">
{{ participation.person.short_name }}
({{ participation.tardiness }}′)
{% if personal_note.note %}
<span>
{{ personal_note.person.short_name }}
<!-- MAYBE: Shorten note -->
({{ personal_note.note }})
</span>
{% endif %}
{% for personal_note in doc.personal_notes %}
{% if personal_note.extra_mark %}
<span>
{{ personal_note.person.short_name }}
({{ personal_note.extra_mark.short_name }})
</span>
{% endif %}
{% if personal_note.note %}
<span>
{{ personal_note.person.short_name }}
<!-- MAYBE: Shorten note -->
({{ personal_note.note }})
</span>
{% endif %}
{% endfor %}
{% endfor %}
</td>
<td class="lesson-te">
{% if documentation.topic %}
{{ doc.teachers.first.short_name }}
{% endif %}
</td>
</tr>
{% endfor %}
{% endwith %}
{% endfor %}
{% endfor %}
</td>
<td class="lesson-te">
{% if documentation.topic %}
{{ doc.teachers.first.short_name }}
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
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