Aktualizace balicku, strnakovani, uprava hlavni stranky

This commit is contained in:
Michal Kváček
2023-12-12 23:42:16 +01:00
parent 8c7e237053
commit c8ea17c1ec
67 changed files with 1372 additions and 774 deletions
@@ -0,0 +1,93 @@
<script>
import {usePointsOfInterestStore} from "stores/PointsOfInterest";
export default {
preFetch({currentRoute}) {
return usePointsOfInterestStore().fetchPublicDetail(currentRoute.params.id);
}
}
</script>
<script setup>
import {storeToRefs} from "pinia";
import {usePhotosStore} from "stores/Photos";
import ContentCard from "components/ContentCard.vue";
import PhotoGallery from "components/photos/PhotoGallery.vue";
import {useFlightsStore} from "stores/Flights";
import EmbeddedMap from "components/map/EmbeddedMap.vue";
import FlightsList from "components/flights/FlightsList.vue";
import {useAppStore} from "stores/App";
import {useMeta} from "quasar";
import {metaData} from "src/composables/meta";
import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleton.vue";
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
import {onMounted} from "vue";
import PhotoGallerySkeleton from "components/photos/skeletons/PhotoGallerySkeleton.vue";
import {loadPage, paginationLimit} from "src/composables/pagination";
const {pointOfInterest, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
const {photos, isQueryRunning: arePhotosLoading} = storeToRefs(usePhotosStore());
const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRefs(useFlightsStore());
useAppStore().setPageTitle(pointOfInterest.value.name);
useMeta(() => metaData({
title: pointOfInterest.value.name,
image: pointOfInterest.value.titlePhoto?.url,
description: pointOfInterest.value.description,
}));
useAppStore().setBreadcrumbs([
{to: {name: 'homepage'}, label: "Polétání.cz"},
{to: {name: 'publicPOIs'}, label: "Místa"},
{label: pointOfInterest.value.name}
]);
const loadNextFlightsPage = (appendItems) => loadPage({
fetchFunc: useFlightsStore().fetchPublic,
filters: {pointOfInterestId: pointOfInterest.value.id},
appendItems
});
onMounted(() => {
usePhotosStore().fetchPublic({pointOfInterestId: pointOfInterest.value.id});
loadNextFlightsPage(false);
});
</script>
<template>
<q-spinner v-if="isQueryRunning || !pointOfInterest"/>
<ContentCard :title-photo="pointOfInterest.titlePhoto" :title="pointOfInterest.name" v-else>
<template #content>
<q-card-section>
<article v-html="pointOfInterest.description" class="q-my-lg"/>
<EmbeddedMap
v-if="pointOfInterest.gpsLatitude && pointOfInterest.gpsLongitude"
:gps-latitude="pointOfInterest.gpsLatitude"
:gps-longitude="pointOfInterest.gpsLongitude"
:zoom="13"
/>
<PhotoGallerySkeleton v-if="arePhotosLoading && !pointOfInterest"/>
<PhotoGallery :photos="photos" class="q-my-lg" v-else/>
<h3>Lety na místo {{ pointOfInterest.name }}</h3>
<FlightsListSkeleton v-if="areFlightsLoading && flights.length"/>
<BasicInfoBanner v-else-if="!areFlightsLoading && flights.length === 0">
Zdá se, že na toto místo ještě nikdo neletěl. Zatím tu nejsou ještě žádné lety.
</BasicInfoBanner>
<FlightsList
v-else
:items="flights"
:total-items-count="totalItemsCount"
:is-query-running="areFlightsLoading"
:items-per-page="paginationLimit"
:public="true"
@load-more="loadNextFlightsPage(true)"
/>
</q-card-section>
</template>
</ContentCard>
</template>
@@ -0,0 +1,41 @@
<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";
import {loadPage, paginationLimit} from "src/composables/pagination";
useAppStore().setPageTitle("Místa");
useAppStore().setBreadcrumbs([
{to: {name: 'homepage'}, label: "Polétání.cz"},
{label: "Místa"},
]);
useMeta(() => metaData({
title: "Místa"
}))
const loadNextPage = (appendItems) => loadPage({
fetchFunc: usePointsOfInterestStore().fetchPublic,
appendItems
});
loadNextPage(false);
const {pointsOfInterest, totalItemsCount, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
</script>
<template>
<BasicListSkeleton :items="paginationLimit" v-if="isQueryRunning && !pointsOfInterest.length"/>
<POIList
v-else
:public="true"
:items="pointsOfInterest"
:total-items-count="totalItemsCount"
:is-query-running="isQueryRunning"
:items-per-page="paginationLimit"
@load-more="loadNextPage(true)"
/>
</template>