Skip to content
Snippets Groups Projects
Commit 925c6d5a authored by permcu's avatar permcu
Browse files

Fixup the tidyup

parent 24251792
No related branches found
No related tags found
1 merge request!422Resolve "Add export functionality to course book"
......@@ -142,12 +142,13 @@ def generate_full_register_printout(
group.as_list = [group]
if include_coursebook:
group.documentations_by_day = documentations.order_by(
group.documentations = documentations.order_by(
"datetime_start"
).prefetch_related(
prefetch_notable_participations(select_related=["person"]),
prefetch_personal_notes("personal_notes", select_related=["person"]),
)
context["groups"] = groups
recorder.set_progress(3 + len(groups), _number_of_steps, _("Generating template ..."))
......
......@@ -14,79 +14,82 @@
</tr>
</thead>
<tbody>
{% for doc in group.documentations_by_day %}
{% for doc in group.documentations %}
{% ifchanged doc.datetime_start.date %}
<tr><th colspan="6">{{ doc.datetime_start.date|date }}</th></tr>
{% endifchanged %}
<tr class="
{% if doc.amends %}
{% if doc.amends.cancelled %}
lesson-cancelled
{% endif %}
{% if forloop.first %}
lessons-day-first
{% endif %}
{% endif %}
">
<td class="lesson-pe">
{% if doc.amends %}
{% if doc.amends.slot_number_start == doc.amends.slot_number_end %}
{{ doc.amends.slot_number_start }}.
{% else %}
{{ doc.amends.slot_number_start }}.–{{ doc.amends.slot_number_end }}.
{% if doc.amends.cancelled %}
lesson-cancelled
{% endif %}
{% if doc.amends.amends %}
lesson-substituted
{% endif %}
{% endif %}
{% ifchanged doc.datetime_start.date %}
lessons-day-first
{% endifchanged %}
">
<td class="lesson-pe">
{% if doc.amends %}
{% if doc.amends.slot_number_start == doc.amends.slot_number_end %}
{{ doc.amends.slot_number_start }}.
{% else %}
{{ doc.datetime_start|time:"H:i" }}-{{ doc.datetime_end|time:"H:i" }}
{{ 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">
{% if doc.subject %}
{{ doc.subject.short_name|default:doc.subject.name }}
{% endif %}
</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.full_name }}
<span style="color: {{ participation.absence_reason.colour }};">
({{ participation.absence_reason.short_name }})
</span>
</span>
{% endif %}
</td>
<td class="lesson-subj">
{% if doc.subject %}
{{ doc.subject.short_name|default:doc.subject.name }}
{% if participation.tardiness %}
<span class="lesson-note-late">
{{ participation.person.full_name }}
({{ participation.tardiness }}′)
</span>
{% endif %}
</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.full_name }}
<span style="color: {{ participation.absence_reason.colour }};">
({{ participation.absence_reason.short_name }})
{% endfor %}
{% for personal_note in doc.personal_notes.all %}
{% if personal_note.extra_mark %}
<span>
{{ personal_note.person .full_name }}
({{ personal_note.extra_mark.short_name }})
</span>
</span>
{% endif %}
{% if participation.tardiness %}
<span class="lesson-note-late">
{{ participation.person.full_name }}
({{ participation.tardiness }})
</span>
{% if personal_note.note %}
<span>
{{ personal_note.person.full_name }}
({{ personal_note.note }})
</span>
{% endif %}
{% endfor %}
{% for personal_note in doc.personal_notes.all %}
{% if personal_note.extra_mark %}
<span>
{{ personal_note.person .full_name }}
({{ personal_note.extra_mark.short_name }})
</span>
{% endif %}
{% if personal_note.note %}
<span>
{{ personal_note.person.full_name }}
({{ personal_note.note }})
</span>
{% endif %}
{% endfor %}
</td>
<td class="lesson-te">
{% if doc.topic %}
{{ doc.get_teachers_short_names|join:', ' }}
{% endif %}
</td>
</tr>
{% endfor %}
</td>
<td class="lesson-te">
{% if doc.topic %}
{{ doc.get_teachers_short_names|join:', ' }}
{% 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