From 50caa18a89895df5fcc9bb68b9414446685e4a4d Mon Sep 17 00:00:00 2001
From: Tom Teichler <tom.teichler@teckids.org>
Date: Sat, 7 Sep 2019 18:41:40 +0200
Subject: [PATCH] Show if lesson is cancelled. Closes #31.

---
 biscuit/apps/chronos/tables.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/biscuit/apps/chronos/tables.py b/biscuit/apps/chronos/tables.py
index 12a0d4ac..ad0408e0 100644
--- a/biscuit/apps/chronos/tables.py
+++ b/biscuit/apps/chronos/tables.py
@@ -11,7 +11,10 @@ from .models import LessonPeriod
 
 def _css_class_from_lesson_state(record: Optional[LessonPeriod] = None, table: Optional[LessonsTable] = None) -> str:
     if record.get_substitution(record._week):
-        return 'table-warning'
+        if record.get_substitution(record._week).cancelled:
+            return 'table-danger'
+        else:
+            return 'table-warning'
     else:
         return ''
 
-- 
GitLab