From 5181b642c730166389cd48f16625cea303673502 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Sat, 25 Mar 2023 20:34:10 +0100 Subject: [PATCH 01/13] basic impementation of a calendar --- webclient/components/CalendarModal.vue | 116 +++++++++++++++++++++++++ webclient/package.json | 3 +- 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 webclient/components/CalendarModal.vue diff --git a/webclient/components/CalendarModal.vue b/webclient/components/CalendarModal.vue new file mode 100644 index 000000000..5cad523e1 --- /dev/null +++ b/webclient/components/CalendarModal.vue @@ -0,0 +1,116 @@ + + + diff --git a/webclient/package.json b/webclient/package.json index adf469cf9..fff4ab899 100644 --- a/webclient/package.json +++ b/webclient/package.json @@ -28,7 +28,8 @@ "swaggerdark": "github:octycs/SwaggerDark#f02d394c8ff698cdd93e09c2188b058d2d686ca3", "vue": "3.4.31", "vue-router": "4.4.0", - "vue3-carousel": "0.3.3" + "vue3-carousel": "0.3.3", + "vue-simple-calendar": "7.1.0" }, "devDependencies": { "@nuxt/eslint": "0.3.13", From cd8f2356bc7fa59b9c99a3a8da0c02dc38bc93f3 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Fri, 21 Apr 2023 22:41:53 +0200 Subject: [PATCH 02/13] refactored the design to make it more like the google calendar --- webclient/components/CalendarModal.vue | 60 ++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/webclient/components/CalendarModal.vue b/webclient/components/CalendarModal.vue index 5cad523e1..dd6786d13 100644 --- a/webclient/components/CalendarModal.vue +++ b/webclient/components/CalendarModal.vue @@ -8,7 +8,7 @@ import { useRoute } from "vue-router"; import type { components } from "@/api_types"; type CalendarResponse = components["schemas"]["CalendarResponse"]; import "/node_modules/vue-simple-calendar/dist/style.css"; -import "/node_modules/vue-simple-calendar/dist/css/default.css"; +import "/node_modules/vue-simple-calendar/dist/css/gcal.css"; import { useFetch } from "@/composables/fetch"; const global = useGlobalStore(); @@ -76,9 +76,10 @@ function setShowDate(d: Date) { :items="events" :show-date="showDate" :showTimes="true" - :timeFormatOptions="{ hour: '2-digit', minute: '2-digit' }" + :timeFormatOptions="{ hour: '2-digit', minute: '2-digit', hour12: false }" :startingDayOfWeek="1" - class="theme-default" + :itemTop="'2.5em'" + class="theme-gcal" > From 9cf030cc6ab7705044b77ebde92b7e8d69a24da2 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Sun, 28 Apr 2024 06:08:19 +0200 Subject: [PATCH 03/13] Adapted the calendar to changing requirements --- webclient/components/CalendarModal.vue | 299 +++++++++++++------------ webclient/composables/calendar.ts | 9 + webclient/pages/[view]/[id].vue | 15 +- webclient/pnpm-lock.yaml | 12 + webclient/tailwind.config.ts | 17 +- 5 files changed, 204 insertions(+), 148 deletions(-) create mode 100644 webclient/composables/calendar.ts diff --git a/webclient/components/CalendarModal.vue b/webclient/components/CalendarModal.vue index dd6786d13..f6da175f1 100644 --- a/webclient/components/CalendarModal.vue +++ b/webclient/components/CalendarModal.vue @@ -1,170 +1,183 @@ + - + + +de: + title: Kalendar + close: Schließen + Loading data...: Lädt daten... + error: + header: Beim Versuch, den Kalender anzuzeigen, ist ein Fehler aufgetreten + reason: Der Grund für diesen Fehler ist + call_to_action: Wenn dieses Problem weiterhin besteht, kontaktieren Sie uns bitte über das Feedback-Formular am Ende der Seite. + footer: + disclaimer: Stündlich aktualisiert und identische Termine zusammengefasst. + please_check: Im Zweifelsfall prüfe bitte den offiziellen TUMonline-Kalender. + last_sync: Stand {0} +en: + title: Calendar + close: Close + Loading data...: Loading data... + error: + header: Got an error trying to display calendar + reason: Reason for this error is + call_to_action: If this issue persists, please contact us via the feedback form at the bottom of the page + footer: + disclaimer: Updated hourly and identical events are merged. + please_check: If in doubt, please check the official calendar on TUMonline + last_sync: Updated {0} + diff --git a/webclient/composables/calendar.ts b/webclient/composables/calendar.ts new file mode 100644 index 000000000..252ce28ab --- /dev/null +++ b/webclient/composables/calendar.ts @@ -0,0 +1,9 @@ +type CalendarState = { + open: boolean; + showing: string[]; +}; +export const useCalendar = () => + useState("calendar", () => ({ + open: false, + showing: [], + })); diff --git a/webclient/pages/[view]/[id].vue b/webclient/pages/[view]/[id].vue index 5f9fda12e..9883df2a0 100644 --- a/webclient/pages/[view]/[id].vue +++ b/webclient/pages/[view]/[id].vue @@ -19,6 +19,7 @@ const { t, locale } = useI18n({ useScope: "local" }); const route = useRoute(); const router = useRouter(); +const calendar = useCalendar(); const runtimeConfig = useRuntimeConfig(); const url = computed(() => `${runtimeConfig.public.apiURL}/api/get/${route.params.id}?lang=${locale.value}`); const { data, error } = useFetch(url, { @@ -173,15 +174,18 @@ onMounted(() => {
{{ data.type_common_name }}
- - + @@ -287,6 +291,9 @@ onMounted(() => { {{ t("Loading data...") }}
+ + + diff --git a/webclient/pnpm-lock.yaml b/webclient/pnpm-lock.yaml index 0cbd33843..0e1ff9aba 100644 --- a/webclient/pnpm-lock.yaml +++ b/webclient/pnpm-lock.yaml @@ -53,6 +53,9 @@ importers: vue-router: specifier: 4.4.0 version: 4.4.0(vue@3.4.31(typescript@5.4.5)) + vue-simple-calendar: + specifier: 7.1.0 + version: 7.1.0(typescript@5.4.5) vue3-carousel: specifier: 0.3.3 version: 0.3.3(vue@3.4.31(typescript@5.4.5)) @@ -6362,6 +6365,9 @@ packages: peerDependencies: vue: ^3.2.0 + vue-simple-calendar@7.1.0: + resolution: {integrity: sha512-WNbvRVGQQJlStaLPvvpe2ZsB/E1n8eFgUh4hD931ljp2czPA8xT81i4jGD5+jKZT1OHDFpON5mNn0KwO2QC9rA==} + vue-template-compiler@2.7.16: resolution: {integrity: sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==} @@ -14582,6 +14588,12 @@ snapshots: '@vue/devtools-api': 6.6.1 vue: 3.4.31(typescript@5.4.5) + vue-simple-calendar@7.1.0(typescript@5.4.5): + dependencies: + vue: 3.4.31(typescript@5.4.5) + transitivePeerDependencies: + - typescript + vue-template-compiler@2.7.16: dependencies: de-indent: 1.0.2 diff --git a/webclient/tailwind.config.ts b/webclient/tailwind.config.ts index 4ab84893f..dbcd1b94d 100644 --- a/webclient/tailwind.config.ts +++ b/webclient/tailwind.config.ts @@ -1,5 +1,5 @@ import type { Config } from "tailwindcss"; -import { current, inherit, orange, red, transparent, white, zinc } from "tailwindcss/colors"; +import { current, green, inherit, orange, red, transparent, white, zinc } from "tailwindcss/colors"; export default >{ darkMode: "class", @@ -12,6 +12,21 @@ export default >{ white, zinc, orange, + green, + "fuchsia-pink": { + "50": "#faf5fa", + "100": "#f7ecf6", + "200": "#f1d9f0", + "300": "#e6bbe2", + "400": "#d591cf", + "500": "#c56fb9", + DEFAULT: "#b55ca5", + "600": "#b55ca5", + "700": "#973f85", + "800": "#7d376d", + "900": "#6a315d", + "950": "#3f1837", + }, red, blue: { 50: "#f3f6fc", From 30cc736a2713abb6184fabeab9ee397a5f815bf2 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Mon, 24 Jun 2024 02:17:10 +0200 Subject: [PATCH 04/13] tmp --- webclient/components/CalendarModal.vue | 117 +++++++++++++++++++------ webclient/pages/[view]/[id].vue | 2 +- 2 files changed, 89 insertions(+), 30 deletions(-) diff --git a/webclient/components/CalendarModal.vue b/webclient/components/CalendarModal.vue index f6da175f1..17511258c 100644 --- a/webclient/components/CalendarModal.vue +++ b/webclient/components/CalendarModal.vue @@ -1,17 +1,22 @@ + + + + diff --git a/webclient/components/CalendarModal.vue b/webclient/components/CalendarModal.vue index 31c41355b..5d9293e6b 100644 --- a/webclient/components/CalendarModal.vue +++ b/webclient/components/CalendarModal.vue @@ -1,219 +1,117 @@ - - de: title: Kalendar close: Schließen - Loading data...: Lädt daten... - number_of_events: ein Event pro Quartal | {count} Events pro Quartal error: header: Beim Versuch, den Kalender anzuzeigen, ist ein Fehler aufgetreten reason: Der Grund für diesen Fehler ist @@ -224,19 +122,19 @@ de: disclaimer: Stündlich aktualisiert und identische Termine zusammengefasst. please_check: Im Zweifelsfall prüfe bitte den offiziellen TUMonline-Kalender. last_sync: Stand {0} + call_for_feedback: Diese Funktion ist neu. Wenn du Feedback dazu hast, nutze doch bitte das {feedbackForm}. en: title: Calendar close: Close - Loading data...: Loading data... error: header: Got an error trying to display calendar reason: Reason for this error is call_to_action: If this issue persists, please contact us via the {feedbackForm}. feedback-form: feedback form feedback-open: open the feedback form - number_of_events: ein event per quarter | {count} events per quarter footer: disclaimer: Updated hourly and identical events are merged. please_check: If in doubt, please check the official calendar on TUMonline last_sync: Updated {0} + call_for_feedback: This feature is new. If you have some feedback about it, feel free to use the {feedbackForm}. diff --git a/webclient/components/CalendarRoomSelector.vue b/webclient/components/CalendarRoomSelector.vue new file mode 100644 index 000000000..829817fb0 --- /dev/null +++ b/webclient/components/CalendarRoomSelector.vue @@ -0,0 +1,137 @@ + + + + + +de: + add_location: Zusätzliche Location zum Kalendar hinzufügen + view_in_tumonline: in TUMonline ansehen + prompt: + initial: |- + Welcher Kalender soll hinzugefügt werden? + Bitte wähle nur den letzten Teil der Url eines Raumes mit einem Kalender. + + Beispiel: + https://nav.tum.de/room/5502.01.250 hat die ID 5502.01.250 + error_not_ok: |- + Der Ort '{0}' existiert nicht. + Wenn er existieren würde, gäbe es https://nav.tum.de/view/{0}. + + Möchtest du es mit einer anderen ID erneut versuchen? + error_not_calendar: |- + Der Ort hat keinen Kalender. + Möchtest du es mit einer anderen ID erneut versuchen? + error_already_exists: |- + Der Ort ist bereits im Kalender eingetragen. + Möchtest du es mit einer anderen ID erneut versuchen? + Loading data...: Lädt daten... +en: + add_location: add additional location to the calendar + view_in_tumonline: View in TUMonline + prompt: + initial: |- + Which calendar should be added? + Please select just the last part of the url of a room with a calendar. + + Example: + https://nav.tum.de/room/5502.01.250 has the id 5502.01.250 + error_not_ok: |- + Location '{0}' does not exist. + If it were to exist https://nav.tum.de/view/{0} would exist. + Want to retry with a different id? + error_not_calendar: |- + Location does not have a calendar. + Want to retry with a different id? + error_already_exists: |- + Location is already in the calendar. + Want to retry with a different id? + Loading data...: Loading data... + diff --git a/webclient/components/DetailsImageSlideshowModal.vue b/webclient/components/DetailsImageSlideshowModal.vue index 081a49244..c3ac2538f 100644 --- a/webclient/components/DetailsImageSlideshowModal.vue +++ b/webclient/components/DetailsImageSlideshowModal.vue @@ -40,7 +40,7 @@ const subtitles = computed(() => { diff --git a/webclient/components/Modal.vue b/webclient/components/Modal.vue index 1a9a55649..d5b3b00ed 100644 --- a/webclient/components/Modal.vue +++ b/webclient/components/Modal.vue @@ -4,19 +4,11 @@ import { XMarkIcon } from "@heroicons/vue/24/outline"; export interface Props { title: string; disableClose?: boolean; - classes?: { - background?: string; - close?: string; - modal?: string; - }; + class?: string; } const props = withDefaults(defineProps(), { - classes: () => ({ - background: "", - close: "", - modal: "", - }), + class: "", }); const emit = defineEmits(["close"]); const isOpen = defineModel({ required: true }); @@ -60,13 +52,9 @@ function close() {
-
+

{{ props.title }}