109 lines
2.7 KiB
Vue
109 lines
2.7 KiB
Vue
<template>
|
|
<q-layout view="hhh lpR lff">
|
|
<q-header reveal elevated class="bg-primary text-white">
|
|
<q-toolbar>
|
|
<q-btn
|
|
flat
|
|
dense
|
|
round
|
|
icon="menu"
|
|
aria-label="Menu"
|
|
@click="toggleLeftDrawer"
|
|
/>
|
|
|
|
<q-toolbar-title>
|
|
{{ pageTitle || "Polétání.cz" }}
|
|
</q-toolbar-title>
|
|
|
|
<router-link :to="{name: 'profile'}">
|
|
<AvatarFromPhoto :size="32" :src="loggedUser.avatarImageUrl"/>
|
|
</router-link>
|
|
|
|
</q-toolbar>
|
|
</q-header>
|
|
|
|
<q-drawer
|
|
v-model="leftDrawerOpen"
|
|
show-if-above
|
|
bordered
|
|
>
|
|
|
|
<q-img class="absolute-top" :src="loggedUser.titleImageUrl" style="height: 150px">
|
|
</q-img>
|
|
<q-scroll-area style="height: calc(100% - 150px); margin-top: 150px; border-right: 1px solid #ddd">
|
|
<q-list class="q-my-lg">
|
|
<template v-for="link in linksList" :key="link.title">
|
|
<q-separator v-if="link.separator"/>
|
|
<NavigationButton
|
|
v-if="!link.separator"
|
|
v-bind="link"
|
|
/>
|
|
</template>
|
|
</q-list>
|
|
</q-scroll-area>
|
|
</q-drawer>
|
|
|
|
<q-page-container class="q-px-md">
|
|
<BreadcrumbsNavigation class="q-mx-md q-my-md" :items="breadcrumbs"/>
|
|
<router-view/>
|
|
</q-page-container>
|
|
</q-layout>
|
|
</template>
|
|
|
|
<script setup>
|
|
import {onMounted, ref, watch} from 'vue'
|
|
import NavigationButton from "components/navigation/NavigationButton.vue";
|
|
import {useUserStore} from "stores/User";
|
|
import {storeToRefs} from "pinia";
|
|
import BreadcrumbsNavigation from "components/BreadcrumbsNavigation.vue";
|
|
import {useAppStore} from "stores/App";
|
|
import {useMeta} from "quasar";
|
|
import AvatarFromPhoto from "components/AvatarFromPhoto.vue";
|
|
|
|
const {pageTitle, breadcrumbs} = storeToRefs(useAppStore());
|
|
useMeta(() => ({
|
|
title: pageTitle.value !== '' ? `${pageTitle.value} - Polétání.cz` : 'Polétání.cz'
|
|
}));
|
|
|
|
const linksList = [
|
|
{
|
|
title: 'Přidat let',
|
|
icon: 'airplane_ticket',
|
|
to: {name: "addFlight"}
|
|
},
|
|
{
|
|
title: 'Moje lety',
|
|
icon: "flight_takeoff",
|
|
to: {name: "myFlights"}
|
|
},
|
|
{separator: true},
|
|
{
|
|
title: 'Letadla',
|
|
icon: "connecting_airports",
|
|
to: {name: "aircrafts"}
|
|
},
|
|
{separator: true},
|
|
{
|
|
title: 'Zajímavá místa',
|
|
icon: "place",
|
|
to: {name: "poi"}
|
|
},
|
|
{separator: true},
|
|
{
|
|
title: 'Spolucestující',
|
|
icon: "people",
|
|
to: {name: "copilots"}
|
|
},
|
|
]
|
|
|
|
const leftDrawerOpen = ref(false)
|
|
const toggleLeftDrawer = () => {
|
|
leftDrawerOpen.value = !leftDrawerOpen.value
|
|
};
|
|
|
|
onMounted(() => {
|
|
useUserStore().fetchLoggedUserDetail();
|
|
})
|
|
const loggedUser = storeToRefs(useUserStore()).user;
|
|
</script>
|