wrbapp/frontend/pages/settings/index.vue

86 lines
3.0 KiB
Vue
Raw Normal View History

2022-09-16 21:11:44 +02:00
<template>
2023-01-22 15:34:32 +01:00
<div class="flex flex-col gap-5 mx-auto p-2 w-full max-w-md">
<div>
<h1 class="text-xl ml-2 font-bold">Info</h1>
<div class="container">
<div class="item">
2023-03-20 11:23:46 +01:00
Email: <b>{{ userStore.user.email }}</b>
2022-09-16 21:11:44 +02:00
</div>
2023-01-22 15:34:32 +01:00
<div class="divider" />
<div class="item">
2023-03-20 11:23:46 +01:00
Personen: <b>{{ userStore.userPersons.map(a => a.fullName).join(', ')}}</b>
2022-09-16 21:11:44 +02:00
</div>
2023-01-22 15:34:32 +01:00
<div class="divider" />
<div class="item">
Groepen: <b>{{ groups.join(', ') }}</b>
2022-09-16 21:11:44 +02:00
</div>
2023-03-20 11:23:46 +01:00
<div v-if="userStore.userPersons.map(a => a.diploma).filter(n => n !== '').join('')" class="divider" />
<div v-if="userStore.userPersons.map(a => a.diploma).filter(n => n !== '').join('')" class="item">
Diploma: <b>{{ userStore.userPersons.map(a => a.diploma).filter(n => n !== '').join(', ')}}</b>
2022-09-20 17:33:15 +02:00
</div>
2023-01-22 15:34:32 +01:00
<div class="divider" />
<NuxtLink to="/settings/moreinfo" class="item-hover py-2 rounded-t flex items-center">
<span>Meer Informatie</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
</div>
2022-09-16 21:11:44 +02:00
</div>
2023-01-22 15:34:32 +01:00
<div>
<h1 class="text-xl ml-2 font-bold">Account</h1>
<div class="container">
<NuxtLink to="/settings/config/managerelatiecodes" class="item-hover py-2 rounded-t flex items-center">
<span>Beheer Personen</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<NuxtLink to="/settings/config/changepassword" class="item-hover py-2 flex items-center">
<span>Wachtwoord Wijzigen</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<div @click="logout" class="item-hover rounded-b flex items-center">
Uitloggen
</div>
</div>
</div>
2023-03-20 11:23:46 +01:00
<div v-if="userStore.userData.admin">
2023-01-22 15:34:32 +01:00
<h1 class="text-xl ml-2 font-bold">Admin</h1>
<div class="container">
<NuxtLink to="/settings/admin/users" class="rounded-t item-hover py-2 flex items-center">
<span>Beheer gebruikers</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
<div class="divider" />
<NuxtLink to="/settings/admin/ledenlijst" class="rounded-b item-hover py-2 flex items-center">
<span>Ledenlijst</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink>
</div>
</div>
<div>
<h2 class="text-center font-bold">Gemaakt door <u><a href="https://xeovalyte.com/">Timo Boomers</a></u></h2>
</div>
</div>
2022-09-16 21:11:44 +02:00
</template>
<script setup>
2022-09-20 15:53:44 +02:00
import { signOut } from "firebase/auth";
2022-09-16 21:11:44 +02:00
definePageMeta({
2023-01-22 15:34:32 +01:00
title: 'Settings'
2022-09-16 21:11:44 +02:00
})
2022-09-20 15:53:44 +02:00
2023-03-20 11:23:46 +01:00
const userStore = useUserStore()
2022-09-22 17:10:36 +02:00
const groups = computed(() => {
2023-03-20 11:23:46 +01:00
return [...new Set(userStore.userPersons.map(a => a.groups.join()).join().split(','))]
2022-09-22 17:10:36 +02:00
})
2022-09-20 15:53:44 +02:00
const logout = () => {
2023-03-20 11:23:46 +01:00
signOut(userStore.auth)
2023-01-22 15:34:32 +01:00
.catch((error) => {
console.log(error)
})
2022-09-20 15:53:44 +02:00
}
2022-12-29 12:54:58 +01:00
</script>