ff-admin/src/views/admin/club/protocol/ProtocolRouting.vue

96 lines
3.3 KiB
Vue
Raw Normal View History

2024-10-03 13:43:13 +02:00
<template>
<MainTemplate>
<template #headerInsert>
<RouterLink to="../" class="text-primary">zurück zur Liste</RouterLink>
</template>
<template #topBar>
<div class="flex flex-row gap-2 items-center justify-between pt-5 pb-3 px-7">
<h1 class="font-bold text-xl h-8 min-h-fit grow">
{{ activeProtocolObj?.title }}, {{ activeProtocolObj?.date }}
</h1>
2024-10-04 12:47:04 +02:00
<CloudIcon v-if="syncing == 'synced'" class="w-5 h-5" />
<CloudArrowUpIcon v-else-if="syncing == 'detectedChanges'" class="w-5 h-5" />
<ArrowPathIcon v-else-if="syncing == 'syncing'" class="w-5 h-5 animate-spin" />
<ExclamationTriangleIcon v-else class="w-5 h-5 animate-[ping_1s_ease-in-out_3] text-red-500" />
2024-10-03 13:43:13 +02:00
<TrashIcon class="w-5 h-5 cursor-pointer" @click="openDeleteModal" />
</div>
</template>
<template #diffMain>
<div class="flex flex-col gap-2 grow px-7 overflow-hidden">
<div class="flex flex-col grow gap-2 overflow-hidden">
<div class="w-full flex flex-row max-lg:flex-wrap justify-center">
<RouterLink
v-for="tab in tabs"
:key="tab.route"
v-slot="{ isActive }"
:to="{ name: tab.route }"
class="w-1/2 md:w-1/3 lg:w-full p-0.5 first:pl-0 last:pr-0"
>
<p
:class="[
'w-full rounded-lg py-2.5 text-sm text-center font-medium leading-5 focus:ring-0 outline-none',
isActive ? 'bg-red-200 shadow border-b-2 border-primary rounded-b-none' : ' hover:bg-red-200',
]"
>
{{ tab.title }}
</p>
</RouterLink>
</div>
<RouterView />
</div>
</div>
</template>
</MainTemplate>
</template>
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
import { mapActions, mapState } from "pinia";
import MainTemplate from "@/templates/Main.vue";
import { RouterLink, RouterView } from "vue-router";
import { useProtocolStore } from "@/stores/admin/protocol";
2024-10-04 12:47:04 +02:00
import {
ArrowPathIcon,
CloudArrowUpIcon,
CloudIcon,
ExclamationTriangleIcon,
TrashIcon,
} from "@heroicons/vue/24/outline";
2024-10-03 13:43:13 +02:00
import { useModalStore } from "@/stores/modal";
</script>
<script lang="ts">
export default defineComponent({
props: {
protocolId: String,
},
data() {
return {
2024-10-04 12:47:04 +02:00
tabs: [
{ route: "admin-club-protocol-overview", title: "Übersicht" },
2024-10-11 14:43:56 +02:00
{ route: "admin-club-protocol-presence", title: "Anwesenheit" },
2024-10-04 12:47:04 +02:00
{ route: "admin-club-protocol-voting", title: "Abstimmungen" },
2024-10-08 10:43:16 +02:00
{ route: "admin-club-protocol-decisions", title: "Beschlüsse" },
2024-10-11 14:43:56 +02:00
{ route: "admin-club-protocol-agenda", title: "Protokoll" },
2024-10-04 12:47:04 +02:00
],
2024-10-03 13:43:13 +02:00
};
},
computed: {
2024-10-04 12:47:04 +02:00
...mapState(useProtocolStore, ["activeProtocolObj", "syncing"]),
2024-10-03 13:43:13 +02:00
},
mounted() {
this.fetchProtocolByActiveId();
},
methods: {
...mapActions(useProtocolStore, ["fetchProtocolByActiveId"]),
...mapActions(useModalStore, ["openModal"]),
openDeleteModal() {
// this.openModal(
// markRaw(defineAsyncComponent(() => import("@/components/admin/club/protocol/DeleteProtocolModal.vue"))),
// parseInt(this.protocolId ?? "")
// );
},
},
});
</script>