From ad29d0682ef04b1ca45c424404e6f6237e8f3b05 Mon Sep 17 00:00:00 2001 From: Jonas Gerg Date: Tue, 14 Jul 2026 21:51:55 +0200 Subject: [PATCH] feat: add list view with GottesdienstCard components - New GottesdienstCard component shows each service with its info - Shows the currently logged-in user's mark as a toggle checkbox - Lists ministrants who have responded with their mark status - Admin view hides the checkbox, shows responses only - New ListView wrapper renders all cards - PlanView gets a Tabelle/Liste toggle between table and card views --- public/src/components/GottesdienstCard.vue | 345 +++++++++++++++++++++ public/src/components/ListView.vue | 37 +++ public/src/views/PlanView.vue | 111 +++++-- 3 files changed, 470 insertions(+), 23 deletions(-) create mode 100644 public/src/components/GottesdienstCard.vue create mode 100644 public/src/components/ListView.vue diff --git a/public/src/components/GottesdienstCard.vue b/public/src/components/GottesdienstCard.vue new file mode 100644 index 0000000..f57e05b --- /dev/null +++ b/public/src/components/GottesdienstCard.vue @@ -0,0 +1,345 @@ + + + + + diff --git a/public/src/components/ListView.vue b/public/src/components/ListView.vue new file mode 100644 index 0000000..ff9f6d2 --- /dev/null +++ b/public/src/components/ListView.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/public/src/views/PlanView.vue b/public/src/views/PlanView.vue index deb49d0..d86497f 100644 --- a/public/src/views/PlanView.vue +++ b/public/src/views/PlanView.vue @@ -5,6 +5,7 @@ import TablePlan from "@/components/TablePlan.vue"; import {API, UnauthorizedError} from "@/services/api"; import type {Gottesdienst, GottesdienstGroup, Mark, SimplifiedMinistrant} from "@/models/models"; import MobilePlan from "@/components/MobilePlan.vue"; +import ListView from "@/components/ListView.vue"; import PlanActionBar from "@/components/PlanActionBar.vue"; import {Auth} from "@/services/auth"; import GroupView from "@/components/GroupView.vue"; @@ -38,6 +39,8 @@ const plan = reactive<{ groups: [] }) const mobile = ref(window.innerWidth <= MAX_WIDTH_MOBILE) +const viewMode = ref<"table" | "list">("table") +const currentUsername = ref("") const editedMarks = reactive([]); const editPlanAdmin = ref(false) const planId = ref(parseInt(route.params.id as string)) @@ -79,6 +82,7 @@ async function loadPlan() { Auth.loggedInSubject.subscribe(async (loggedIn) => { console.log("logged in " + loggedIn) if (loggedIn) { + currentUsername.value = Auth.getUser() plan.editable = Auth.getPrivileges() if (Auth.getUser() == "admin") { editPlanAdmin.value = true @@ -86,6 +90,7 @@ Auth.loggedInSubject.subscribe(async (loggedIn) => { console.log("Plan", plan.ministranten) } } else { + currentUsername.value = "" editPlanAdmin.value = false plan.editable = [] } @@ -312,40 +317,70 @@ async function importZelebrationsplan() {