public calendar view and secured type edit
This commit is contained in:
parent
5bb107e53a
commit
e9a3e0c872
10 changed files with 145 additions and 6 deletions
|
@ -28,6 +28,10 @@
|
|||
<input type="checkbox" id="nscdr" v-model="calendarType.nscdr" />
|
||||
<label for="nscdr">Standard Kalender Auslieferung (optional)</label>
|
||||
</div>
|
||||
<div v-if="!calendarType.nscdr">
|
||||
<label for="passphrase">Passphrase (optional)</label>
|
||||
<input type="text" id="passphrase" v-model="calendarType.passphrase" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row justify-end gap-2">
|
||||
<button primary-outline type="reset" class="!w-fit" :disabled="canSaveOrReset" @click="resetForm">
|
||||
|
@ -111,6 +115,7 @@ export default defineComponent({
|
|||
type: formData.type.value,
|
||||
color: formData.color.value,
|
||||
nscdr: formData.nscdr.checked,
|
||||
passphrase: formData.passphrase.value,
|
||||
};
|
||||
this.status = "loading";
|
||||
this.updateActiveCalendarType(updateCalendarType)
|
||||
|
|
12
src/views/public/View.vue
Normal file
12
src/views/public/View.vue
Normal file
|
@ -0,0 +1,12 @@
|
|||
<template>
|
||||
<FullContent>
|
||||
<template #main>
|
||||
<RouterView />
|
||||
</template>
|
||||
</FullContent>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RouterView } from "vue-router";
|
||||
import FullContent from "../../layouts/FullContent.vue";
|
||||
</script>
|
84
src/views/public/calendar/Calendar.vue
Normal file
84
src/views/public/calendar/Calendar.vue
Normal file
|
@ -0,0 +1,84 @@
|
|||
<template>
|
||||
<MainTemplate :showBack="false">
|
||||
<template #topBar>
|
||||
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
|
||||
<h1 class="font-bold text-xl h-8">Kalender</h1>
|
||||
</div>
|
||||
</template>
|
||||
<template #diffMain>
|
||||
<div class="flex flex-col w-full h-full gap-2 justify-between px-7 overflow-hidden">
|
||||
<FullCalendar :options="calendarOptions" class="max-h-full h-full" />
|
||||
</div>
|
||||
</template>
|
||||
</MainTemplate>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import MainTemplate from "@/templates/Main.vue";
|
||||
import FullCalendar from "@fullcalendar/vue3";
|
||||
import deLocale from "@fullcalendar/core/locales/de";
|
||||
import dayGridPlugin from "@fullcalendar/daygrid";
|
||||
import timeGridPlugin from "@fullcalendar/timegrid";
|
||||
import interactionPlugin from "@fullcalendar/interaction";
|
||||
import type { CalendarViewModel } from "@/viewmodels/admin/calendar.models";
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
calendars: [] as Array<CalendarViewModel>,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
formattedItems() {
|
||||
return this.calendars.map((c) => ({
|
||||
id: c.id,
|
||||
title: c.title,
|
||||
start: c.starttime,
|
||||
end: c.endtime,
|
||||
backgroundColor: c.type.color,
|
||||
}));
|
||||
},
|
||||
calendarOptions() {
|
||||
return {
|
||||
timeZone: "local",
|
||||
locale: deLocale,
|
||||
plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
|
||||
initialView: "dayGridMonth",
|
||||
headerToolbar: {
|
||||
left: "dayGridMonth,timeGridWeek",
|
||||
center: "title",
|
||||
right: "prev,today,next",
|
||||
},
|
||||
eventDisplay: "block",
|
||||
weekends: true,
|
||||
editable: false,
|
||||
selectable: false,
|
||||
selectMirror: false,
|
||||
dayMaxEvents: true,
|
||||
weekNumbers: true,
|
||||
displayEventTime: true,
|
||||
nowIndicator: true,
|
||||
weekText: "KW",
|
||||
allDaySlot: false,
|
||||
events: this.formattedItems,
|
||||
};
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.fetchCalendars();
|
||||
},
|
||||
methods: {
|
||||
fetchCalendars() {
|
||||
this.$http
|
||||
.get("/public/calendar?output=json")
|
||||
.then((result) => {
|
||||
this.calendars = result.data;
|
||||
})
|
||||
.catch((err) => {});
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue