diff --git a/src/helpers/quillConfig.ts b/src/helpers/quillConfig.ts new file mode 100644 index 0000000..4761b98 --- /dev/null +++ b/src/helpers/quillConfig.ts @@ -0,0 +1,8 @@ +export const toolbarOptions = [ + [{ header: [1, 2, false] }, { font: [] }], + [{ header: 1 }, { header: 2 }], + ["bold", "italic", "underline", "strike"], + ["blockquote", "code-block", "link"], + [{ list: "ordered" }, { list: "bullet" }, { list: "check" }], + ["clean"], +]; diff --git a/src/router/authGuards.ts b/src/router/authGuards.ts index 5e7ece7..cbedad9 100644 --- a/src/router/authGuards.ts +++ b/src/router/authGuards.ts @@ -68,7 +68,7 @@ export async function isAuthenticatedPromise(): Promise { var { firstname, lastname, mail, username, permissions } = decoded; - if (Object.keys(permissions).length === 0) { + if (Object.keys(permissions ?? {}).length === 0) { auth.setFailed(); reject("nopermissions"); } diff --git a/src/router/index.ts b/src/router/index.ts index ba48a6d..f281ee0 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -174,11 +174,27 @@ const router = createRouter({ props: true, }, { - path: "edit", - name: "admin-club-protocol-edit", - component: () => import("@/views/admin/protocol/ProtocolEdit.vue"), - meta: { type: "update", section: "club", module: "member" }, - beforeEnter: [abilityAndNavUpdate], + path: "precense", + name: "admin-club-protocol-precense", + component: () => import("@/views/admin/protocol/ProtocolPrecense.vue"), + props: true, + }, + { + path: "voting", + name: "admin-club-protocol-voting", + component: () => import("@/views/admin/protocol/ProtocolVoting.vue"), + props: true, + }, + { + path: "decisions", + name: "admin-club-protocol-decisions", + component: () => import("@/views/admin/protocol/ProtocolDecisions.vue"), + props: true, + }, + { + path: "protocol", + name: "admin-club-protocol-protocol", + component: () => import("@/views/admin/protocol/ProtocolProtocol.vue"), props: true, }, ], diff --git a/src/stores/admin/protocol.ts b/src/stores/admin/protocol.ts index 1d19bf3..3dd3b13 100644 --- a/src/stores/admin/protocol.ts +++ b/src/stores/admin/protocol.ts @@ -13,6 +13,7 @@ export const useProtocolStore = defineStore("protocol", { activeProtocol: null as number | null, activeProtocolObj: null as ProtocolViewModel | null, loadingActive: "loading" as "loading" | "fetched" | "failed", + syncing: "synced" as "synced" | "syncing" | "detectedChanges" | "failed", }; }, actions: { diff --git a/src/viewmodels/admin/protocol.models.ts b/src/viewmodels/admin/protocol.models.ts index 95b6272..a30fb3c 100644 --- a/src/viewmodels/admin/protocol.models.ts +++ b/src/viewmodels/admin/protocol.models.ts @@ -2,15 +2,24 @@ export interface ProtocolViewModel { id: number; title: string; date: Date; + starttime: Date; + endtime: Date; + summary: string; } export interface CreateProtocolViewModel { title: string; date: Date; + starttime: Date; + endtime: Date; + summary: string; } export interface UpdateProtocolViewModel { id: number; title: string; date: Date; + starttime: Date; + endtime: Date; + summary: string; } diff --git a/src/views/admin/protocol/ProtocolDecisions.vue b/src/views/admin/protocol/ProtocolDecisions.vue new file mode 100644 index 0000000..8bd9e6d --- /dev/null +++ b/src/views/admin/protocol/ProtocolDecisions.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/src/views/admin/protocol/ProtocolEdit.vue b/src/views/admin/protocol/ProtocolEdit.vue deleted file mode 100644 index f78c4cd..0000000 --- a/src/views/admin/protocol/ProtocolEdit.vue +++ /dev/null @@ -1,111 +0,0 @@ - - - - - diff --git a/src/views/admin/protocol/ProtocolOverview.vue b/src/views/admin/protocol/ProtocolOverview.vue index f0fda79..24f8d01 100644 --- a/src/views/admin/protocol/ProtocolOverview.vue +++ b/src/views/admin/protocol/ProtocolOverview.vue @@ -1,6 +1,37 @@ @@ -48,7 +49,13 @@ import { mapActions, mapState } from "pinia"; import MainTemplate from "@/templates/Main.vue"; import { RouterLink, RouterView } from "vue-router"; import { useProtocolStore } from "@/stores/admin/protocol"; -import { PencilIcon, TrashIcon } from "@heroicons/vue/24/outline"; +import { + ArrowPathIcon, + CloudArrowUpIcon, + CloudIcon, + ExclamationTriangleIcon, + TrashIcon, +} from "@heroicons/vue/24/outline"; import { useModalStore } from "@/stores/modal"; @@ -59,11 +66,17 @@ export default defineComponent({ }, data() { return { - tabs: [{ route: "admin-club-protocol-overview", title: "Übersicht" }], + tabs: [ + { route: "admin-club-protocol-overview", title: "Übersicht" }, + { route: "admin-club-protocol-precense", title: "Anwesenheit" }, + { route: "admin-club-protocol-voting", title: "Abstimmungen" }, + { route: "admin-club-protocol-decisions", title: "Entscheidungen" }, + { route: "admin-club-protocol-protocol", title: "Protokoll" }, + ], }; }, computed: { - ...mapState(useProtocolStore, ["activeProtocolObj"]), + ...mapState(useProtocolStore, ["activeProtocolObj", "syncing"]), }, mounted() { this.fetchProtocolByActiveId(); diff --git a/src/views/admin/protocol/ProtocolVoting.vue b/src/views/admin/protocol/ProtocolVoting.vue new file mode 100644 index 0000000..8bd9e6d --- /dev/null +++ b/src/views/admin/protocol/ProtocolVoting.vue @@ -0,0 +1,29 @@ + + + + +