From ad2f36477ca4d157dfd4fb46f187c9580bae97f5 Mon Sep 17 00:00:00 2001
From: Michael Bauer <michael-bauer@posteo.de>
Date: Tue, 15 Oct 2024 16:10:48 +0200
Subject: [PATCH] Link to affected teachers

---
 .../frontend/components/Substitutions.vue      | 18 ++++++++++++++++--
 .../frontend/components/substitutions.graphql  |  1 +
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/aleksis/apps/chronos/frontend/components/Substitutions.vue b/aleksis/apps/chronos/frontend/components/Substitutions.vue
index 2f9de371..ee54fc56 100644
--- a/aleksis/apps/chronos/frontend/components/Substitutions.vue
+++ b/aleksis/apps/chronos/frontend/components/Substitutions.vue
@@ -17,8 +17,22 @@ import CRUDList from "aleksis.core/components/generic/CRUDList.vue";
       <!-- TODO: 18n -->
       <v-container>
       <v-row>
-        <v-col> Betroffene Lehrkräfte </v-col>
-        <v-col> {{ affectedTeachers.map(t => t.shortName || t.fullName).join(', ') }} </v-col>
+        <v-col cols="4"> Betroffene Lehrkräfte </v-col>
+        <v-col cols="8">
+          <v-chip
+            v-for="(teacher, i) in affectedTeachers"
+            class="ma-1"
+            :to="{
+              name: 'chronos.timetableWithId',
+              params: {
+                type: 'person',
+                id: teacher.id,
+              },
+            }"
+          >
+            {{ teacher.shortName || teacher.fullName }}
+          </v-chip>
+        </v-col>
         <v-spacer/>
       </v-row>
       <v-row>
diff --git a/aleksis/apps/chronos/frontend/components/substitutions.graphql b/aleksis/apps/chronos/frontend/components/substitutions.graphql
index 0e61901c..8759c00c 100644
--- a/aleksis/apps/chronos/frontend/components/substitutions.graphql
+++ b/aleksis/apps/chronos/frontend/components/substitutions.graphql
@@ -1,6 +1,7 @@
 query substitutionsForDate ($date: Date!) {
   items: substitutionsForDate(date: $date) {
     affectedTeachers {
+      id
       shortName
       fullName
     }
-- 
GitLab