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

Fixup the tidyup

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