Verejny seznam POI
This commit is contained in:
@@ -3,12 +3,23 @@ const props = defineProps({
|
|||||||
items: {
|
items: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: false
|
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>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-list bordered separator>
|
<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-item-section avatar>
|
||||||
<q-avatar v-if="poi.titlePhoto">
|
<q-avatar v-if="poi.titlePhoto">
|
||||||
<img :src="poi.titlePhoto.thumbnailUrl" alt=""/>
|
<img :src="poi.titlePhoto.thumbnailUrl" alt=""/>
|
||||||
@@ -19,7 +30,6 @@ const props = defineProps({
|
|||||||
{{ poi.name }}
|
{{ poi.name }}
|
||||||
<div class="text-secondary" v-if="poi.type">
|
<div class="text-secondary" v-if="poi.type">
|
||||||
{{ poi.type.name }}
|
{{ poi.type.name }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section side top v-if="poi.isPublic">
|
<q-item-section side top v-if="poi.isPublic">
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ const {isQueryRunning, pointsOfInterest} = storeToRefs(usePointsOfInterestStore(
|
|||||||
|
|
||||||
<POIList
|
<POIList
|
||||||
v-else
|
v-else
|
||||||
|
:public="false"
|
||||||
:items="pointsOfInterest"
|
:items="pointsOfInterest"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ useMeta(() => metaData({
|
|||||||
}));
|
}));
|
||||||
useAppStore().setBreadcrumbs([
|
useAppStore().setBreadcrumbs([
|
||||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||||
|
{to: {name: 'publicPOIs'}, label: "Místa"},
|
||||||
{label: pointOfInterest.value.name}
|
{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: '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')},
|
{path: 'mista/:id', name: "publicPOIDetail", component: () => import('pages/public/PointOfInterestDetailPage.vue')},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user