From 5898a46a1b15e5bd85b13eaf790386a5ad6249f7 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Sat, 6 Sep 2025 19:25:20 +0200 Subject: [PATCH] Add UI to edit and display event notices Add a warning like display of event notices to the event card and the event slot card and indicate in the timesheet that an event has a notice. Also includes the input controls needed to edit the notice. --- components/CardEvent.vue | 24 ++++++++++++++++++++++++ components/CardEventSlot.vue | 24 ++++++++++++++++++++++++ components/TableScheduleEvents.vue | 19 ++++++++++++++++++- components/Timetable.vue | 1 + server/generate-demo-schedule.ts | 4 +++- 5 files changed, 70 insertions(+), 2 deletions(-) diff --git a/components/CardEvent.vue b/components/CardEvent.vue index 4082abc..baca351 100644 --- a/components/CardEvent.vue +++ b/components/CardEvent.vue @@ -8,6 +8,14 @@

Host: {{ event.host }}

+
+
+ ⚠️ +
+

+ {{ event.notice }} +

+

{{ event.description ?? "No description provided" }}

{{ event.interested }} interested @@ -79,6 +87,22 @@ async function toggle(type: "event" | "slot", id: number, slotIds?: number[]) { margin-block-start: 0.5rem; } +.notice { + display: flex; + width: fit-content; + gap: 0.5rem; + padding: 0.5rem; + margin-block: 0.5rem; + border-radius: 0.25rem; + border: 1px solid color-mix(in oklab, CanvasText, orange 50%); + background-color: color-mix(in oklab, Canvas, orange 40%); +} +.noticeIcon { + flex: 0 0 auto; + align-self: center; + font-size: 1rem; +} + button { padding-inline: 0.2em; } diff --git a/components/CardEventSlot.vue b/components/CardEventSlot.vue index baa2e3a..3544be2 100644 --- a/components/CardEventSlot.vue +++ b/components/CardEventSlot.vue @@ -13,6 +13,14 @@

Host: {{ event.host }}

+
+
+ ⚠️ +
+

+ {{ event.notice }} +

+

{{ event?.description ?? "No description provided" }}

At {{ locations.map(location => location?.name ?? "unknown").join(" + ") }} @@ -62,6 +70,22 @@ function formatTime(time: DateTime) { margin-block-start: 0.5rem; } +.notice { + display: flex; + width: fit-content; + gap: 0.5rem; + padding: 0.5rem; + margin-block: 0.5rem; + border-radius: 0.25rem; + border: 1px solid color-mix(in oklab, CanvasText, orange 50%); + background-color: color-mix(in oklab, Canvas, orange 40%); +} +.noticeIcon { + flex: 0 0 auto; + align-self: center; + font-size: 1rem; +} + button { padding-inline: 0.2em; } diff --git a/components/TableScheduleEvents.vue b/components/TableScheduleEvents.vue index 7555bf3..ab66e81 100644 --- a/components/TableScheduleEvents.vue +++ b/components/TableScheduleEvents.vue @@ -10,6 +10,7 @@ id name host + notice description p s @@ -38,6 +39,13 @@ v-model="event.host" > + +