diff --git a/ui/src/api/calendar.ts b/ui/src/api/calendar.ts new file mode 100644 index 0000000..d4c01ac --- /dev/null +++ b/ui/src/api/calendar.ts @@ -0,0 +1,42 @@ +export interface CalendarEvent { + name: string, + start: Date, + end: Date, + location: string, + color: string, + description: string, + creator: any | null, // user object + id: number | null +} + +export enum CalendarAttendance { + Attending = "attending", + NotAttending = "not_attending", + Maybe = "maybe" +} + +export interface CalendarSignup { + memberID: number, + eventID: number, + state: CalendarAttendance +} + +export async function createCalendarEvent(eventData: CalendarEvent) { + +} + +export async function editCalendarEvent(eventData: CalendarEvent) { + +} + +export async function cancelCalendarEvent(eventID: number) { + +} + +export async function adminCancelCalendarEvent(eventID: number) { + +} + +export async function setCalendarEventAttendance(eventID: number, state: CalendarAttendance) { + +} \ No newline at end of file diff --git a/ui/src/components/calendar/CreateCalendarEvent.vue b/ui/src/components/calendar/CreateCalendarEvent.vue new file mode 100644 index 0000000..d2e5355 --- /dev/null +++ b/ui/src/components/calendar/CreateCalendarEvent.vue @@ -0,0 +1,257 @@ + + + + + + + + Create Event + + + { onSubmit(vals); resetForm({ values: initialValues }); })"> + + + + + + + Event Name + + + + + + + + + + + + + Color + + + + + + + + + + + + + + + + Start Date + + + + + + + + + + Start Time + + + + + + + + + + + + + + End Date + + + + + + + + + + End Time + + + + + + + + + + + + Location + + + + + + + + + + + + Description + + + + + + + + + + + + + + + Create + + + + + diff --git a/ui/src/pages/Calendar.vue b/ui/src/pages/Calendar.vue index 15a5f35..58855e9 100644 --- a/ui/src/pages/Calendar.vue +++ b/ui/src/pages/Calendar.vue @@ -4,6 +4,7 @@ import FullCalendar from '@fullcalendar/vue3' import dayGridPlugin from '@fullcalendar/daygrid' import interactionPlugin from '@fullcalendar/interaction' import { X, Clock, MapPin, User, ListTodo, ChevronLeft, ChevronRight, Plus } from 'lucide-vue-next' +import CreateCalendarEvent from '@/components/calendar/CreateCalendarEvent.vue' const monthLabels = [ 'January', 'February', 'March', 'April', 'May', 'June', @@ -63,16 +64,19 @@ function onEventClick(arg: any) { panelOpen.value = true } +const dialogRef = ref(null) + // NEW: handle day/time slot clicks to start creating an event function onDateClick(arg: { dateStr: string }) { + dialogRef.value?.openDialog(); // For now, just open the panel with a draft payload. - activeEvent.value = { - id: '__draft__', - title: 'New event', - start: arg.dateStr, - extendedProps: { draft: true } - } - panelOpen.value = true + // activeEvent.value = { + // id: '__draft__', + // title: 'New event', + // start: arg.dateStr, + // extendedProps: { draft: true } + // } + // panelOpen.value = true } const calendarOptions = ref({ @@ -127,6 +131,8 @@ const calendarOptions = ref({ }, }) +//@ts-ignore (shhh) +calendarOptions.value.datesSet = onDatesSet watch(panelOpen, async () => { @@ -165,6 +171,8 @@ const ext = computed(() => activeEvent.value?.extendedProps ?? {}) + + @@ -196,20 +204,20 @@ const ext = computed(() => activeEvent.value?.extendedProps ?? {}) - + Today Create