Skip to content
Snippets Groups Projects
Verified Commit 3105d246 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Fix design for cancelled lessons and don't allow participation status with cancelled lessons

parent a89ff166
No related branches found
No related tags found
1 merge request!371Fix design for cancelled lessons and don't allow participation status with cancelled lessons
Pipeline #191406 failed
......@@ -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
......
......@@ -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="
......
......@@ -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
......
......@@ -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:
......
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