hid member controls from non member accounts in the calendar
This commit is contained in:
@@ -80,6 +80,7 @@ async function setAttendance(state: CalendarAttendance) {
|
|||||||
|
|
||||||
const canEditEvent = computed(() => {
|
const canEditEvent = computed(() => {
|
||||||
if (!userStore.isLoggedIn) return false;
|
if (!userStore.isLoggedIn) return false;
|
||||||
|
if (userStore.state !== 'member') return false;
|
||||||
if (userStore.user.member.member_id == activeEvent.value.creator_id)
|
if (userStore.user.member.member_id == activeEvent.value.creator_id)
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
@@ -215,7 +216,7 @@ defineExpose({ forceReload })
|
|||||||
<CircleAlert></CircleAlert> This event has been cancelled
|
<CircleAlert></CircleAlert> This event has been cancelled
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</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">
|
<ButtonGroup class="flex w-full">
|
||||||
<Button variant="outline"
|
<Button variant="outline"
|
||||||
:class="myAttendance?.status === CalendarAttendance.Attending ? 'border-2 border-primary text-primary' : ''"
|
:class="myAttendance?.status === CalendarAttendance.Attending ? 'border-2 border-primary text-primary' : ''"
|
||||||
|
|||||||
@@ -49,15 +49,8 @@ const dialogRef = ref<any>(null)
|
|||||||
// NEW: handle day/time slot clicks to start creating an event
|
// NEW: handle day/time slot clicks to start creating an event
|
||||||
function onDateClick(arg: { dateStr: string }) {
|
function onDateClick(arg: { dateStr: string }) {
|
||||||
if (!userStore.isLoggedIn) return;
|
if (!userStore.isLoggedIn) return;
|
||||||
|
if (userStore.state !== 'member') return;
|
||||||
dialogRef.value?.openDialog(arg.dateStr);
|
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({
|
const calendarOptions = ref({
|
||||||
@@ -203,7 +196,7 @@ onMounted(() => {
|
|||||||
@click="goToday">
|
@click="goToday">
|
||||||
Today
|
Today
|
||||||
</button>
|
</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"
|
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">
|
@click="onCreateEvent">
|
||||||
<Plus class="h-4 w-4" />
|
<Plus class="h-4 w-4" />
|
||||||
|
|||||||
Reference in New Issue
Block a user