feat(Dashboard): set up components
This commit is contained in:
parent
a370db7cc9
commit
2fe757b2a6
1 changed files with 26 additions and 1 deletions
|
@ -1,9 +1,34 @@
|
|||
<script setup lang="ts">
|
||||
import CalendarShowEvent from "@/components/content/partials/CalendarShowEvent.vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {ref} from "vue";
|
||||
import {useAuthStore} from "@/stores/auth.store.ts";
|
||||
|
||||
const auth = useAuthStore();
|
||||
const userRole = auth.userData.user.role;
|
||||
|
||||
const editMode = ref(false);
|
||||
|
||||
const toggleEditMode = () => {
|
||||
editMode.value = !editMode.value;
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
const navigateToCreateShow = () => {
|
||||
// TODO Change route to correct one
|
||||
router.push({name: 'CreateShow'});
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>dashboard</div>
|
||||
<v-row class="ma-4 justify-space-around">
|
||||
<!-- TODO show only if user is Editor or admin-->
|
||||
<template v-if="userRole && (userRole == 'admin' || userRole == 'editor')">
|
||||
<v-btn color="primary" @click="navigateToCreateShow">Crea show</v-btn>
|
||||
<v-btn color="secondary" @click="toggleEditMode">{{ editMode ? 'Disabilita modifica calendario' : 'Abilita modifica calendario' }}</v-btn>
|
||||
</template>
|
||||
</v-row>
|
||||
<CalendarShowEvent :edit-mode="editMode"/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue