diff --git a/aleksis/apps/alsijil/templates/alsijil/partials/legend.html b/aleksis/apps/alsijil/templates/alsijil/partials/legend.html index a2c6ba1aaee02c492155c08b902f1562b405b3a7..bf0c82d792b57943b36502f0b94dff3db193a70d 100644 --- a/aleksis/apps/alsijil/templates/alsijil/partials/legend.html +++ b/aleksis/apps/alsijil/templates/alsijil/partials/legend.html @@ -7,17 +7,21 @@ <h6>{% trans "General" %}</h6> <ul class="collection"> <li class="collection-item chip-height"> - <strong>(a)</strong> {% trans "Absences" %} + <strong>{% trans "(a)" %}</strong> {% trans "Absences" %} <span class="chip secondary-color white-text right">0</span> </li> <li class="collection-item chip-height"> - <strong>(u)</strong> {% trans "Unexcused absences" %} + <strong>{% trans "(u)" %}</strong> {% trans "Unexcused absences" %} <span class="chip red white-text right">0</span> </li> <li class="collection-item chip-height"> - <strong>(e)</strong> {% trans "Excused absences" %} + <strong>{% trans "Sum (e)" %}</strong> {% trans "Sum of excused absences" %} <span class="chip green white-text right">0</span> </li> + <li class="collection-item chip-height"> + <strong>{% trans "(e)" %}</strong> {% trans "Regular excused absences" %} + <span class="chip grey white-text right">0</span> + </li> </ul> </div> @@ -33,6 +37,18 @@ </li> {% endfor %} </ul> + {% if excuse_types_not_absent %} + <h6>{% trans "Excuse types (not counted as absent)" %}</h6> + + <ul class="collection"> + {% for excuse_type in excuse_types_not_absent %} + <li class="collection-item chip-height"> + <strong>({{ excuse_type.short_name }})</strong> {{ excuse_type.name }} + <span class="chip grey white-text right">0</span> + </li> + {% endfor %} + </ul> + {% endif %} </div> {% endif %} diff --git a/aleksis/apps/alsijil/templates/alsijil/partials/persons_with_stats.html b/aleksis/apps/alsijil/templates/alsijil/partials/persons_with_stats.html index 404705dfbc3fe7cb4d6cfde5561ed2f3fb82de13..efa5bc3a89d72c75fbf5f3d1c9de5426c668270f 100644 --- a/aleksis/apps/alsijil/templates/alsijil/partials/persons_with_stats.html +++ b/aleksis/apps/alsijil/templates/alsijil/partials/persons_with_stats.html @@ -11,7 +11,8 @@ <tr class="hide-on-med-and-down"> <th rowspan="2">{% trans "Name" %}</th> <th rowspan="2">{% trans "Primary group" %}</th> - <th colspan="{{ excuse_types.count|add:3 }}">{% trans "Absences" %}</th> + <th colspan="{{ excuse_types.count|add:4 }}">{% trans "Absences" %}</th> + <th colspan="{{ excuse_types_not_absent.count }}">{% trans "Uncounted Absences" %}</th> <th rowspan="2">{% trans "Tardiness" %}</th> {% if extra_marks %} <th colspan="{{ extra_marks.count }}">{% trans "Extra marks" %}</th> @@ -22,6 +23,7 @@ <th class="truncate">{% trans "Name" %}</th> <th class="truncate">{% trans "Primary group" %}</th> <th class="truncate chip-height">{% trans "Absences" %}</th> + <th class="chip-height">{% trans "Sum (e)" %}</th> <th class="chip-height">{% trans "(e)" %}</th> {% for excuse_type in excuse_types %} <th class="chip-height"> @@ -29,6 +31,11 @@ </th> {% endfor %} <th class="chip-height">{% trans "(u)" %}</th> + {% for excuse_type in excuse_types_not_absent %} + <th class="chip-height"> + ({{ excuse_type.short_name }}) + </th> + {% endfor %} <th class="truncate chip-height">{% trans "Tardiness" %}</th> {% for extra_mark in extra_marks %} <th class="chip-height"> @@ -39,6 +46,7 @@ </tr> <tr class="hide-on-med-and-down"> <th>{% trans "Sum" %}</th> + <th>{% trans "Sum (e)" %}</th> <th>{% trans "(e)" %}</th> {% for excuse_type in excuse_types %} <th> @@ -46,6 +54,11 @@ </th> {% endfor %} <th>{% trans "(u)" %}</th> + {% for excuse_type in excuse_types_not_absent %} + <th> + ({{ excuse_type.short_name }}) + </th> + {% endfor %} {% for extra_mark in extra_marks %} <th> {{ extra_mark.short_name }} @@ -73,6 +86,11 @@ {{ person.excused }} </span> </td> + <td> + <span class="chip grey white-text" title="{% trans "Regular excused" %}"> + {{ person.excused_without_excuse_type }} + </span> + </td> {% for excuse_type in excuse_types %} <td> <span class="chip grey white-text" title="{{ excuse_type.name }}"> @@ -85,6 +103,13 @@ {{ person.unexcused }} </span> </td> + {% for excuse_type in excuse_types_not_absent %} + <td> + <span class="chip grey white-text" title="{{ excuse_type.name }}"> + {{ person|get_dict:excuse_type.count_label }} + </span> + </td> + {% endfor %} <td> <span class="chip orange white-text" title="{% trans "Tardiness" %}"> {% firstof person.tardiness|to_time|time:"H\h i\m" "–" %} diff --git a/aleksis/apps/alsijil/views.py b/aleksis/apps/alsijil/views.py index c8297882d674187f80e9d79489686b292c34a98a..4efd1174aa79bb607f46979088271ec6f32d5e25 100644 --- a/aleksis/apps/alsijil/views.py +++ b/aleksis/apps/alsijil/views.py @@ -751,7 +751,8 @@ def my_students(request: HttpRequest) -> HttpResponse: new_groups.append((group, persons_for_group)) context["groups"] = new_groups - context["excuse_types"] = ExcuseType.objects.all() + context["excuse_types"] = ExcuseType.objects.filter(count_as_absent=True) + context["excuse_types_not_absent"] = ExcuseType.objects.filter(count_as_absent=False) context["extra_marks"] = ExtraMark.objects.all() return render(request, "alsijil/class_register/persons.html", context) @@ -777,7 +778,8 @@ class StudentsList(PermissionRequiredMixin, DetailView): context["group"] = self.object context["persons"] = self.object.generate_person_list_with_class_register_statistics() context["extra_marks"] = ExtraMark.objects.all() - context["excuse_types"] = ExcuseType.objects.all() + context["excuse_types"] = ExcuseType.objects.filter(count_as_absent=True) + context["excuse_types_not_absent"] = ExcuseType.objects.filter(count_as_absent=False) return context