Changes in Document Creation, Calendar, Notifications, Settings

This commit is contained in:
2024-03-04 20:26:30 +01:00
parent 8e69cda09b
commit 8f444bd917
12 changed files with 315 additions and 71 deletions

View File

@@ -13,6 +13,7 @@ definePageMeta({
//Config
const route = useRoute()
const router = useRouter()
const mode = ref(route.params.mode || "grid")
const supabase = useSupabaseClient()
const dataStore = useDataStore()
@@ -102,7 +103,10 @@ const calendarOptionsGrid = reactive({
newEventData.value.start = info.startStr
newEventData.value.end = info.endStr
showNewEventModal.value = true
//showNewEventModal.value = true
router.push(`/calendar/edit/?start=${info.startStr}&end=${info.endStr}&source=grid`)
},
eventClick: function (info){
selectedEvent.value = info.event
@@ -138,7 +142,9 @@ const calendarOptionsTimeline = reactive({
newEventData.value.end = info.endStr
console.log(newEventData.value)
convertResourceIds()
showNewEventModal.value = true
//showNewEventModal.value = true
router.push(`/calendar/edit/?start=${info.startStr}&end=${info.endStr}&resources=${JSON.stringify([info.resource.id])}&source=timeline`)
},
eventClick: function (info){
selectedEvent.value = info.event

View File

@@ -0,0 +1,118 @@
<script setup>
const route = useRoute()
const router = useRouter()
const dataStore = useDataStore()
const itemInfo = ref({
resources: []
})
const setupPage = () => {
if(route.query.start) itemInfo.value.start = route.query.start.replace(" ", "+")
if(route.query.end) itemInfo.value.end = route.query.end.replace(" ", "+")
if(route.query.resources) itemInfo.value.resources = JSON.parse(route.query.resources)
if(route.query.project) itemInfo.value.project = route.query.project
}
setupPage()
</script>
<template>
<UDashboardNavbar title="Neuen Termin erstellen">
<template #right>
<UButton
color="rose"
@click="router.push(`/calendar/${route.query.source}`)"
>
Abbrechen
</UButton>
<UButton
@click="dataStore.createNewItem('events',itemInfo)"
>
Erstellen
</UButton>
</template>
</UDashboardNavbar>
<!-- <UDashboardToolbar>
</UDashboardToolbar>-->
<UForm class="p-5">
<UFormGroup
label="Resource:"
>
<USelectMenu
v-model="itemInfo.resources"
:options="dataStore.getResources"
option-attribute="title"
value-attribute="id"
multiple
@change=""
>
<template #label>
<span v-if="itemInfo.resources.length == 0">Keine Ressourcen ausgewählt</span>
<span v-else >{{ itemInfo.resources.length }} ausgewählt</span>
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Titel:"
>
<UInput
v-model="itemInfo.title"
/>
</UFormGroup>
<UFormGroup
label="Projekt:"
>
<USelectMenu
v-model="itemInfo.project"
:options="dataStore.projects"
option-attribute="name"
value-attribute="id"
searchable
searchable-placeholder="Suche..."
:search-attributes="['name']"
>
<template #label>
{{dataStore.getProjectById(itemInfo.project) ? dataStore.getProjectById(itemInfo.project).name : "Kein Projekt ausgewählt"}}
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Typ:"
>
<USelectMenu
v-model="itemInfo.type"
:options="dataStore.getEventTypes"
option-attribute="label"
value-attribute="label"
>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Start:"
>
<UInput
v-model="itemInfo.start"
/>
</UFormGroup>
<UFormGroup
label="Ende:"
>
<UInput
v-model="itemInfo.end"
/>
</UFormGroup>
</UForm>
</template>
<style scoped>
</style>