hid member controls from non member accounts in the calendar

This commit is contained in:
2025-12-17 00:34:21 -05:00
parent 6cb53deee3
commit 2127a48a83
2 changed files with 4 additions and 10 deletions

View File

@@ -80,6 +80,7 @@ async function setAttendance(state: CalendarAttendance) {
const canEditEvent = computed(() => {
if (!userStore.isLoggedIn) return false;
if (userStore.state !== 'member') return false;
if (userStore.user.member.member_id == activeEvent.value.creator_id)
return true;
});
@@ -215,7 +216,7 @@ defineExpose({ forceReload })
<CircleAlert></CircleAlert> This event has been cancelled
</div>
</section>
<section v-if="isPast && userStore.isLoggedIn" class="w-full">
<section v-if="isPast && userStore.state === 'member'" class="w-full">
<ButtonGroup class="flex w-full">
<Button variant="outline"
:class="myAttendance?.status === CalendarAttendance.Attending ? 'border-2 border-primary text-primary' : ''"

View File

@@ -49,15 +49,8 @@ const dialogRef = ref<any>(null)
// NEW: handle day/time slot clicks to start creating an event
function onDateClick(arg: { dateStr: string }) {
if (!userStore.isLoggedIn) return;
if (userStore.state !== 'member') return;
dialogRef.value?.openDialog(arg.dateStr);
// 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
}
const calendarOptions = ref({
@@ -203,7 +196,7 @@ onMounted(() => {
@click="goToday">
Today
</button>
<button v-if="userStore.isLoggedIn"
<button v-if="userStore.isLoggedIn && userStore.state === 'member'"
class="cursor-pointer ml-1 inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground hover:opacity-90"
@click="onCreateEvent">
<Plus class="h-4 w-4" />