Education views in member and config

This commit is contained in:
Julian Krauser 2025-06-02 13:57:06 +02:00
parent 3b89262ce9
commit 05ec4afadb
20 changed files with 1139 additions and 4 deletions

View file

@ -0,0 +1,51 @@
<template>
<div class="flex flex-col gap-2 h-full w-full overflow-y-auto">
<div v-if="memberEducations != null" class="flex flex-col gap-2 w-full">
<MemberEducationListItem v-for="education in memberEducations" :key="education.id" :education="education" />
</div>
<Spinner v-if="loading == 'loading'" class="mx-auto" />
<p v-else-if="loading == 'failed'" @click="fetchItem" class="cursor-pointer">&#8634; laden fehlgeschlagen</p>
</div>
<div class="flex flex-row gap-4">
<button v-if="can('create', 'club', 'member')" primary class="w-fit!" @click="openCreateModal">
Aus-/Fortbildung hinzufügen
</button>
</div>
</template>
<script setup lang="ts">
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
import { mapActions, mapState } from "pinia";
import Spinner from "@/components/Spinner.vue";
import { useMemberEducationStore } from "@/stores/admin/club/member/memberEducation";
import MemberEducationListItem from "@/components/admin/club/member/MemberEducationListItem.vue";
import { useModalStore } from "@/stores/modal";
import { useAbilityStore } from "@/stores/ability";
</script>
<script lang="ts">
export default defineComponent({
props: {
memberId: String,
},
computed: {
...mapState(useMemberEducationStore, ["memberEducations", "loading"]),
...mapState(useAbilityStore, ["can"]),
},
mounted() {
this.fetchItem();
},
methods: {
...mapActions(useMemberEducationStore, ["fetchMemberEducationsForMember"]),
...mapActions(useModalStore, ["openModal"]),
fetchItem() {
this.fetchMemberEducationsForMember();
},
openCreateModal() {
this.openModal(
markRaw(defineAsyncComponent(() => import("@/components/admin/club/member/MemberEducationCreateModal.vue")))
);
},
},
});
</script>

View file

@ -21,7 +21,7 @@
<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">
<div class="w-full flex flex-row max-lg:flex-wrap justify-center items-stretch">
<RouterLink
v-for="tab in tabs"
:key="tab.route"
@ -31,7 +31,7 @@
>
<p
:class="[
'w-full rounded-lg py-2.5 text-sm text-center font-medium leading-5 focus:ring-0 outline-hidden',
'flex w-full h-full items-center justify-center rounded-lg py-2.5 text-sm text-center font-medium leading-5 focus:ring-0 outline-hidden',
isActive ? 'bg-red-200 shadow-sm border-b-2 border-primary rounded-b-none' : ' hover:bg-red-200',
]"
>
@ -68,8 +68,9 @@ export default defineComponent({
{ route: "admin-club-member-overview", title: "Übersicht" },
{ route: "admin-club-member-membership", title: "Mitgliedschaft" },
{ route: "admin-club-member-communication", title: "Kommunikation" },
{ route: "admin-club-member-awards", title: "Auszeichnungen" },
{ route: "admin-club-member-qualifications", title: "Qualifikationen" },
{ route: "admin-club-member-awards", title: "Auszeichnungen / Ehrungen" },
{ route: "admin-club-member-educations", title: "Aus- / Fortbildungen" },
{ route: "admin-club-member-qualifications", title: "Qualifikationen / Funktionen" },
{ route: "admin-club-member-positions", title: "Vereinsämter" },
],
};