diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsTrigger.vue b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsTrigger.vue index 572036c67955b3365bb46eb69f6ab41ee86cf074..a7854c9ae41c9fe73a7d011f60f1abd09ad42145 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsTrigger.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/absences/ManageStudentsTrigger.vue @@ -58,6 +58,7 @@ export default { v-bind="documentationPartProps" @update="() => null" :loading-indicator="loading" + v-if="!documentation.amends?.cancelled" > <template #activator="{ attrs, on }"> <v-chip diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue index 652609dccaf430d3a4ab138f80ee2f810b84b4af..7128bb797bacedda08cf6e5f35f71b6f1bd6faad 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue @@ -38,6 +38,10 @@ import PersonChip from "aleksis.core/components/person/PersonChip.vue"; :subject="documentation.subject" v-bind="compact ? dialogActivator.attrs : {}" v-on="compact ? dialogActivator.on : {}" + :class="{ + 'text-decoration-line-through': documentation.amends?.cancelled, + }" + :disabled="documentation.amends?.cancelled" /> <subject-chip v-if=" diff --git a/aleksis/apps/alsijil/models.py b/aleksis/apps/alsijil/models.py index 9e68ccd06773dc8b0f6ee65ccd16c81319b94a8b..65358c5b9d72dea1daa56c476edd40d8efcd15b7 100644 --- a/aleksis/apps/alsijil/models.py +++ b/aleksis/apps/alsijil/models.py @@ -695,6 +695,7 @@ class Documentation(CalendarEvent): self.participation_touched_at or not self.amends or self.value_start_datetime(self) > now() + or self.amends.cancelled ): # There is no source to update from or it's too early return diff --git a/aleksis/apps/alsijil/util/predicates.py b/aleksis/apps/alsijil/util/predicates.py index 9f06195e279b6e9bc9564731146d33ea7995498d..46e8cec682208d72fdb02e7fb5f9f245f1f3521a 100644 --- a/aleksis/apps/alsijil/util/predicates.py +++ b/aleksis/apps/alsijil/util/predicates.py @@ -450,6 +450,8 @@ def can_edit_documentation(user: User, obj: Documentation): def can_view_participation_status(user: User, obj: Documentation): """Predicate which checks if the user is allowed to view participation for a documentation.""" if obj: + if obj.amends and obj.amends.cancelled: + return False if is_documentation_teacher(user, obj): return True if obj.amends: @@ -465,6 +467,8 @@ def can_view_participation_status(user: User, obj: Documentation): def can_edit_participation_status(user: User, obj: Documentation): """Predicate which checks if the user is allowed to edit participation for a documentation.""" if obj: + if obj.amends and obj.amends.cancelled: + return False if is_documentation_teacher(user, obj): return True if obj.amends: