Verejny seznam POI
This commit is contained in:
@@ -3,12 +3,23 @@ const props = defineProps({
|
||||
items: {
|
||||
type: Array,
|
||||
required: false
|
||||
},
|
||||
public: {
|
||||
type: Boolean,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
const getRoute = (item) => {
|
||||
if (props.public)
|
||||
return {name: "publicPOIDetail", params: {id: item.id}}
|
||||
else
|
||||
return {name: "poiDetail", params: {id: item.id}}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<q-list bordered separator>
|
||||
<q-item clickable v-ripple v-for="poi of items" :key="poi" :to="{name: 'poiDetail', params: {id: poi.id}}">
|
||||
<q-item clickable v-ripple v-for="poi of items" :key="poi" :to="getRoute(poi)">
|
||||
<q-item-section avatar>
|
||||
<q-avatar v-if="poi.titlePhoto">
|
||||
<img :src="poi.titlePhoto.thumbnailUrl" alt=""/>
|
||||
@@ -18,8 +29,7 @@ const props = defineProps({
|
||||
<q-item-section>
|
||||
{{ poi.name }}
|
||||
<div class="text-secondary" v-if="poi.type">
|
||||
{{ poi.type.name }}
|
||||
|
||||
{{ poi.type.name }}
|
||||
</div>
|
||||
</q-item-section>
|
||||
<q-item-section side top v-if="poi.isPublic">
|
||||
|
||||
@@ -26,6 +26,7 @@ const {isQueryRunning, pointsOfInterest} = storeToRefs(usePointsOfInterestStore(
|
||||
|
||||
<POIList
|
||||
v-else
|
||||
:public="false"
|
||||
:items="pointsOfInterest"
|
||||
/>
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ useMeta(() => metaData({
|
||||
}));
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: 'publicPOIs'}, label: "Místa"},
|
||||
{label: pointOfInterest.value.name}
|
||||
]);
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<script setup>
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
poi
|
||||
</template>
|
||||
@@ -0,0 +1,31 @@
|
||||
<script setup>
|
||||
import {usePointsOfInterestStore} from "stores/PointsOfInterest";
|
||||
import {storeToRefs} from "pinia";
|
||||
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
|
||||
import POIList from "components/poi/POIList.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
|
||||
usePointsOfInterestStore().fetchPublic();
|
||||
|
||||
useAppStore().setPageTitle("Místa");
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{label: "Místa"},
|
||||
]);
|
||||
useMeta(() => metaData({
|
||||
title: "Místa"
|
||||
}))
|
||||
|
||||
const {pointsOfInterest, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicListSkeleton :items="10" v-if="isQueryRunning && !pointsOfInterest.length"/>
|
||||
<POIList
|
||||
v-else
|
||||
:public="true"
|
||||
:items="pointsOfInterest"
|
||||
/>
|
||||
</template>
|
||||
@@ -24,7 +24,7 @@ const routes = [
|
||||
]
|
||||
},
|
||||
{path: 'letadlo/:id', name: "publicAircraftDetail", component: () => import('pages/public/AircraftDetailPage.vue')},
|
||||
{path: 'mista', name: "publicPOIs", component: () => import('pages/public/PointsOfInterestMapPage.vue')},
|
||||
{path: 'mista', name: "publicPOIs", component: () => import('pages/public/PointsOfInterestPage.vue')},
|
||||
{path: 'mista/:id', name: "publicPOIDetail", component: () => import('pages/public/PointOfInterestDetailPage.vue')},
|
||||
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user