From 94b5bfcff7dba28e3f21f6d1437f0d0590d147dc Mon Sep 17 00:00:00 2001 From: ajdj100 Date: Fri, 5 Dec 2025 16:28:42 -0500 Subject: [PATCH] Added support for public read only calendar #53 --- ui/src/components/Navigation/Navbar.vue | 6 ++++++ ui/src/components/calendar/ViewCalendarEvent.vue | 16 +++------------- ui/src/pages/Calendar.vue | 16 +++++++++------- ui/src/router/index.js | 4 ++-- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/ui/src/components/Navigation/Navbar.vue b/ui/src/components/Navigation/Navbar.vue index 72c5bd4..c56d592 100644 --- a/ui/src/components/Navigation/Navbar.vue +++ b/ui/src/components/Navigation/Navbar.vue @@ -156,6 +156,12 @@ function blurAfter() { Join + + + + Calendar + + diff --git a/ui/src/components/calendar/ViewCalendarEvent.vue b/ui/src/components/calendar/ViewCalendarEvent.vue index 34fe5f9..c24ca14 100644 --- a/ui/src/components/calendar/ViewCalendarEvent.vue +++ b/ui/src/components/calendar/ViewCalendarEvent.vue @@ -14,22 +14,10 @@ import DropdownMenuItem from '../ui/dropdown-menu/DropdownMenuItem.vue'; import { Calendar } from 'lucide-vue-next'; const route = useRoute(); -// const eventID = computed(() => { -// const id = route.params.id; -// if (typeof id === 'string') return id; -// return undefined; -// }); const loaded = ref(false); const activeEvent = ref(null); -// onMounted(async () => { -// let eventID = route.params.id; -// console.log(eventID); -// activeEvent.value = await getCalendarEvent(Number(eventID)); -// loaded.value = true; -// }); - watch( () => route.params.id, async (id) => { @@ -76,6 +64,7 @@ const viewedState = ref(CalendarAttendance.Attending); let user = useUserStore(); const myAttendance = computed(() => { + if (!user.isLoggedIn) return null; return activeEvent.value.eventSignups.find( (s) => s.member_id === user.user.id ) || null; @@ -88,6 +77,7 @@ async function setAttendance(state: CalendarAttendance) { } const canEditEvent = computed(() => { + if (!user.isLoggedIn) return false; if (user.user.id == activeEvent.value.creator_id) return true; }); @@ -223,7 +213,7 @@ defineExpose({ forceReload }) This event has been cancelled -
+
-