Breadcrumbs resit pres funkce
This commit is contained in:
@@ -1,44 +1,70 @@
|
||||
import {flightName} from "src/composables/flight";
|
||||
|
||||
const homepageBreadcrumbs = () => {
|
||||
return [{to: {name: 'homepage'}, label: "Polétání.cz"}]
|
||||
export const homepageBreadcrumbs = () => {
|
||||
return [{to: {name: 'homepage'}, label: "Polétání.cz"}];
|
||||
}
|
||||
|
||||
export const publicProfileBreadcrumbs = (pilot, link = true) => {
|
||||
const profile = {label: `@${pilot.publicUsername}`}
|
||||
|
||||
// TODO: dodelat
|
||||
if (link) {
|
||||
profile.to = {name: "publicProfileDetail", params: {username: pilot.publicUsername}};
|
||||
}
|
||||
|
||||
const publicProfileBreadcrumbs = (pilot) => {
|
||||
return [
|
||||
...homepageBreadcrumbs(),
|
||||
{to: {name: "publicProfileDetail", params: {username: pilot.publicUsername}}, label: `@${pilot.publicUsername}`},
|
||||
profile,
|
||||
]
|
||||
}
|
||||
|
||||
const publicEventBreadcrumbs = (pilot, event) => {
|
||||
|
||||
export const publicEventBreadcrumbs = (pilot, event, link = true) => {
|
||||
const eventDetail = {label: event.name}
|
||||
if (link) {
|
||||
eventDetail.to = {
|
||||
name: 'publicEventDetail',
|
||||
params: {eventSlug: event.urlSlug, username: pilot.publicUsername}
|
||||
};
|
||||
}
|
||||
return [
|
||||
...publicProfileBreadcrumbs(pilot),
|
||||
{
|
||||
to: {name: 'publicEventsList', username: pilot.publicUsername},
|
||||
label: "Události"
|
||||
},
|
||||
eventDetail
|
||||
]
|
||||
}
|
||||
|
||||
export const flightBreadcrumbs = (pilot, flight, event) => {
|
||||
const breadcrumbs = publicProfileBreadcrumbs(pilot)
|
||||
export const publicFlightBreadcrumbs = (pilot, flight, event, link = true) => {
|
||||
let breadcrumbs;
|
||||
|
||||
if (event && event.isPublic) {
|
||||
breadcrumbs.push({to: {name: 'publicEventsList', username: pilot.publicUsername}, label: "Události"});
|
||||
breadcrumbs.push({
|
||||
to: {
|
||||
name: 'publicEventDetail',
|
||||
params: {eventSlug: event.urlSlug, username: pilot.publicUsername}
|
||||
}, label: event.name
|
||||
});
|
||||
breadcrumbs = publicEventBreadcrumbs(pilot, event)
|
||||
} else {
|
||||
breadcrumbs = publicProfileBreadcrumbs(pilot)
|
||||
}
|
||||
|
||||
breadcrumbs.push({label: flightName(flight)})
|
||||
const flightEntry = {label: flightName(flight)}
|
||||
if (link) {
|
||||
flightEntry.to = {name: "publicFlightDetail", params: {username: pilot.publicUsername, flightSlug: flight.urlSlug}}
|
||||
}
|
||||
breadcrumbs.push(flightEntry)
|
||||
|
||||
return breadcrumbs;
|
||||
}
|
||||
|
||||
export const copilotBreadcrumbs = (pilot, flight, event, copilot) => {
|
||||
export const publicCopilotBreadcrumbs = (pilot, flight, event, copilot) => {
|
||||
return [
|
||||
...flightBreadcrumbs(pilot, flight, event),
|
||||
...publicProfileBreadcrumbs(pilot),
|
||||
{label: "Kopiloti"},
|
||||
{label: copilot.name}
|
||||
]
|
||||
}
|
||||
|
||||
export const publicPOIBaseBreadcrumbs = () => {
|
||||
return [
|
||||
...homepageBreadcrumbs(),
|
||||
{label: "Místa"},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
import {ref} from "vue";
|
||||
|
||||
|
||||
export const usePagination = () => {
|
||||
const paginationLimit = ref(10);
|
||||
export const usePagination = ({fetchFunction, itemsPerPage = 10}) => {
|
||||
if (typeof fetchFunction === "undefined") {
|
||||
console.error("Set fetchFunction to usePagination!");
|
||||
}
|
||||
|
||||
const paginationLimit = ref(itemsPerPage);
|
||||
const paginationOffset = ref(0);
|
||||
const filters = ref({});
|
||||
const loadPage = ({fetchFunc, appendItems}) => {
|
||||
return fetchFunc({
|
||||
const loadPage = ({appendItems}) => {
|
||||
return fetchFunction({
|
||||
...filters.value,
|
||||
limit: paginationLimit.value,
|
||||
offset: paginationOffset.value,
|
||||
@@ -16,7 +20,6 @@ export const usePagination = () => {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
paginationOffset, paginationLimit, filters, loadPage
|
||||
}
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
<script>
|
||||
import {useAircraftsStore} from "stores/Aircrafts";
|
||||
|
||||
export default {
|
||||
serverPrefetch({currentRoute}) {
|
||||
return useAircraftsStore().fetchDetail(currentRoute.params.id);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<script setup>
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {useMeta, useQuasar} from "quasar";
|
||||
@@ -6,7 +16,6 @@ import {confirmObject, successObject} from "src/composables/dialog";
|
||||
import {useAppStore} from "stores/App";
|
||||
import FlightsList from "components/flights/FlightsList.vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {useAircraftsStore} from "stores/Aircrafts";
|
||||
import {watch} from "vue";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import PhotoGallery from "components/photos/PhotoGallery.vue";
|
||||
@@ -24,7 +33,6 @@ import PublishButton from "components/inputs/PublishButton.vue";
|
||||
|
||||
const aircraftId = parseInt(useRoute().params.id);
|
||||
|
||||
useAircraftsStore().fetchDetail(aircraftId);
|
||||
const {aircraft, isQueryRunning} = storeToRefs(useAircraftsStore());
|
||||
watch(() => aircraft.value, (newVal) => {
|
||||
if (!newVal) return;
|
||||
@@ -53,14 +61,11 @@ const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: useAircraftsStore(), object: aircraft.value, variables
|
||||
});
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
filters.value = {aircraftId: aircraftId};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch,
|
||||
appendItems
|
||||
});
|
||||
loadPage(false);
|
||||
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
loadNextFlightsPage(false);
|
||||
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
</script>
|
||||
@@ -114,7 +119,7 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</q-card-section>
|
||||
</template>
|
||||
|
||||
@@ -10,11 +10,8 @@ import {usePagination} from "src/composables/pagination";
|
||||
|
||||
useAppStore().setPageTitle("Letadla");
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const loadNextAircraftsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useAircraftsStore().fetch, appendItems
|
||||
});
|
||||
loadNextAircraftsPage(false);
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useAircraftsStore().fetch});
|
||||
loadPage(false);
|
||||
|
||||
const {aircrafts, totalItemsCount, isQueryRunning} = storeToRefs(useAircraftsStore());
|
||||
</script>
|
||||
@@ -40,7 +37,7 @@ const {aircrafts, totalItemsCount, isQueryRunning} = storeToRefs(useAircraftsSto
|
||||
:items-per-page="paginationLimit"
|
||||
:public="true"
|
||||
class="q-mb-xl"
|
||||
@load-more="loadNextAircraftsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
|
||||
<FAB mode="add" :router-link="{name: 'addAircraft'}"/>
|
||||
|
||||
@@ -30,12 +30,9 @@ const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: useCopilotsStore(), object: copilot.value, variables
|
||||
});
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
filters.value = {copilotId: copilotId};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch, appendItems
|
||||
});
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
const {isQueryRunning, copilot} = storeToRefs(useCopilotsStore());
|
||||
@@ -90,7 +87,7 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
<q-banner v-if="flights.length === 0" class="bg-light-blue text-white">
|
||||
Zatím tu nemáš uložené žádné společné lety.
|
||||
|
||||
@@ -26,7 +26,7 @@ onMounted(() => {
|
||||
{label: event.value.name}
|
||||
])
|
||||
});
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
})
|
||||
|
||||
|
||||
@@ -37,11 +37,8 @@ const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
|
||||
const {isQueryRunning, event} = storeToRefs(useEventsStore());
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
filters.value = {eventId: eventId}
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch, appendItems
|
||||
});
|
||||
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
@@ -65,7 +62,7 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
|
||||
<article class="q-my-lg" v-html="event.description"/>
|
||||
|
||||
<EventFlightsMap :event-id="eventId" :only-public="false" />
|
||||
<EventFlightsMap :event-id="eventId" :only-public="false"/>
|
||||
|
||||
<h3>Lety</h3>
|
||||
|
||||
@@ -80,7 +77,7 @@ const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
<FAB mode="edit" :router-link="{name: 'eventEdit', params: {id: eventId}}"/>
|
||||
</template>
|
||||
|
||||
@@ -11,13 +11,9 @@ import {onMounted} from "vue";
|
||||
|
||||
useAppStore().setPageTitle("Moje lety");
|
||||
|
||||
const {loadPage, paginationLimit} = usePagination();
|
||||
|
||||
const loadNextPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch, appendItems
|
||||
});
|
||||
const {loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
onMounted(() => {
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
});
|
||||
const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore());
|
||||
</script>
|
||||
@@ -40,7 +36,7 @@ const {flights, totalItemsCount, isQueryRunning} = storeToRefs(useFlightsStore()
|
||||
:is-query-running="isQueryRunning"
|
||||
:items-per-page="paginationLimit"
|
||||
:total-items-count="totalItemsCount"
|
||||
@load-more="loadNextPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
|
||||
<FAB mode="add" :router-link="{name: 'addFlight'}"/>
|
||||
|
||||
@@ -14,7 +14,6 @@ import {useOrganizationsStore} from "stores/Organizations";
|
||||
|
||||
const organizationId = parseInt(useRoute().params.id);
|
||||
const loggedUser = storeToRefs(useLoggedUserStore()).user;
|
||||
const $q = useQuasar();
|
||||
|
||||
onMounted(() => {
|
||||
useOrganizationsStore().fetchDetail(organizationId).then((o) => {
|
||||
|
||||
@@ -38,13 +38,9 @@ const togglePublicVisibility = (variables) => toggleVisibility({
|
||||
$q, store: usePointsOfInterestStore(), object: pointOfInterest.value, variables
|
||||
});
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetch});
|
||||
filters.value = {pointOfInterestId: poiId};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetch,
|
||||
appendItems
|
||||
});
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
const {isQueryRunning: areFlightsLoading, totalItemsCount, flights} = storeToRefs(useFlightsStore());
|
||||
const {isQueryRunning, pointOfInterest} = storeToRefs(usePointsOfInterestStore());
|
||||
</script>
|
||||
@@ -114,7 +110,7 @@ const {isQueryRunning, pointOfInterest} = storeToRefs(usePointsOfInterestStore()
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
<BasicInfoBanner v-else>
|
||||
Na tomto místě jsi zatím nebyl/a.
|
||||
|
||||
@@ -12,16 +12,15 @@ import ListFilters from "components/ListFilters.vue";
|
||||
useAppStore().setPageTitle("Zajímavá místa");
|
||||
|
||||
|
||||
const {filters, loadPage, paginationLimit, paginationOffset} = usePagination();
|
||||
paginationLimit.value = 15;
|
||||
const loadNextPage = (appendItems) => loadPage({
|
||||
fetchFunc: usePointsOfInterestStore().fetch, appendItems
|
||||
const {filters, loadPage, paginationLimit, paginationOffset} = usePagination({
|
||||
fetchFunction: usePointsOfInterestStore().fetch,
|
||||
itemsPerPage: 1 // nefunguje
|
||||
});
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
const handleFiltersChanged = (newFilters) => {
|
||||
paginationOffset.value = 0;
|
||||
filters.value = newFilters;
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
}
|
||||
|
||||
const {isQueryRunning, totalItemsCount, pointsOfInterest} = storeToRefs(usePointsOfInterestStore());
|
||||
@@ -47,7 +46,7 @@ const {isQueryRunning, totalItemsCount, pointsOfInterest} = storeToRefs(usePoint
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="isQueryRunning"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
<FAB :router-link="{name: 'addPOI'}" mode="add"/>
|
||||
</template>
|
||||
|
||||
@@ -3,10 +3,11 @@ import {useAppStore} from "stores/App";
|
||||
import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import ContentCard from "components/ContentCard.vue";
|
||||
import {homepageBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
useAppStore().setPageTitle("O projektu");
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
...homepageBreadcrumbs(),
|
||||
{label: "O projektu"}
|
||||
]);
|
||||
useMeta(() => metaData({
|
||||
|
||||
@@ -6,10 +6,11 @@ import {commonProps} from "src/composables/inputs";
|
||||
import {useQuasar} from "quasar";
|
||||
import {errorObject, successObject} from "src/composables/dialog";
|
||||
import {api, axios} from "boot/axios";
|
||||
import {homepageBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
useAppStore().setPageTitle("Kontakt");
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
...homepageBreadcrumbs(),
|
||||
{label: "Kontakt"}
|
||||
]);
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script setup>
|
||||
import {useAppStore} from "stores/App";
|
||||
import ContentCard from "components/ContentCard.vue";
|
||||
import {homepageBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
useAppStore().setPageTitle("Co Polétání.cz umí?");
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
...homepageBreadcrumbs(),
|
||||
{label: "Funkce"}
|
||||
]);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import {useAppStore} from "stores/App";
|
||||
import {onMounted, ref} from "vue";
|
||||
import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import {homepageBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
const $route = useRoute();
|
||||
const help = {
|
||||
@@ -50,7 +51,6 @@ const help = {
|
||||
const opened = ref({});
|
||||
onMounted(() => {
|
||||
opened.value[$route.query.h] = true;
|
||||
|
||||
})
|
||||
|
||||
useAppStore().setPageTitle("Nápověda");
|
||||
@@ -58,7 +58,7 @@ useMeta(() => metaData({
|
||||
title: "Nápověda",
|
||||
}));
|
||||
useAppStore().setBreadcrumbs([
|
||||
{label: "Polétání.cz", to: {name: "homepage"}},
|
||||
...homepageBreadcrumbs(),
|
||||
{label: "Nápověda"},
|
||||
]);
|
||||
</script>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script setup>
|
||||
import ContentCard from "components/ContentCard.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {homepageBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
useAppStore().setPageTitle("Správa osobních údajů");
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
...homepageBreadcrumbs(),
|
||||
{label: "Správa osobních údajů"}
|
||||
]);
|
||||
</script>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script setup>
|
||||
import ContentCard from "components/ContentCard.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {homepageBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
useAppStore().setPageTitle("Podmínky používání");
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
...homepageBreadcrumbs(),
|
||||
{label: "Podmínky používání"}
|
||||
]);
|
||||
</script>
|
||||
|
||||
@@ -8,8 +8,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<script setup>
|
||||
import {useRouter} from "vue-router";
|
||||
import {useMeta, useQuasar} from "quasar";
|
||||
import {useMeta} from "quasar";
|
||||
import AircraftDetailSkeleton from "components/aircrafts/skeletons/AircraftDetailSkeleton.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import FlightsList from "components/flights/FlightsList.vue";
|
||||
@@ -25,9 +24,7 @@ import FlightsListSkeleton from "components/flights/skeletons/FlightsListSkeleto
|
||||
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||
import PhotoGallerySkeleton from "components/photos/skeletons/PhotoGallerySkeleton.vue";
|
||||
import {usePagination} from "src/composables/pagination";
|
||||
|
||||
const $q = useQuasar();
|
||||
const $router = useRouter();
|
||||
import {homepageBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
const {aircraft, isQueryRunning} = storeToRefs(useAircraftsStore());
|
||||
const {photos, isQueryRunning: arePhotosLoading} = storeToRefs(usePhotosStore());
|
||||
@@ -43,20 +40,15 @@ useMeta(() => metaData({
|
||||
description: aircraft.value.description || `Detail letadla ${aircraft.value.callSign}.`
|
||||
}));
|
||||
useAppStore().setBreadcrumbs([
|
||||
{label: "Polétání.cz", to: {name: "homepage"}},
|
||||
...homepageBreadcrumbs(),
|
||||
{label: "Letadla"},
|
||||
{label: aircraft.value.callSign}
|
||||
]);
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetchPublic});
|
||||
filters.value = {aircraftId: aircraft.value.id};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetchPublic, appendItems
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
usePhotosStore().fetchPublic({aircraftId: aircraft.value.id});
|
||||
});
|
||||
</script>
|
||||
@@ -85,7 +77,7 @@ onMounted(() => {
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
:public="true"
|
||||
/>
|
||||
</q-card-section>
|
||||
|
||||
@@ -25,6 +25,7 @@ import {metaData} from "src/composables/meta";
|
||||
import PhotoGallerySkeleton from "components/photos/skeletons/PhotoGallerySkeleton.vue";
|
||||
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||
import {usePagination} from "src/composables/pagination";
|
||||
import {publicCopilotBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
const props = defineProps({
|
||||
pilot: {
|
||||
@@ -38,11 +39,7 @@ const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRef
|
||||
const {photos, isQueryRunning: arePhotosLoading} = storeToRefs(usePhotosStore());
|
||||
|
||||
useAppStore().setPageTitle(`${props.pilot.name} + ${copilot.value.name}`);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: "publicProfileDetail", params: {username: props.pilot.publicUsername}}, label: `@${props.pilot.publicUsername}`},
|
||||
{label: copilot.value.name}
|
||||
]);
|
||||
useAppStore().setBreadcrumbs(publicCopilotBreadcrumbs(props.pilot));
|
||||
|
||||
useMeta(() => metaData({
|
||||
title: copilot.value.name,
|
||||
@@ -51,14 +48,10 @@ useMeta(() => metaData({
|
||||
image: copilot.value.titleImage?.url
|
||||
}));
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetchPublic});
|
||||
filters.value = {copilotId: copilot.value.id};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetchPublic, appendItems
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
usePhotosStore().fetchPublic({copilotId: copilot.value.id})
|
||||
})
|
||||
</script>
|
||||
@@ -82,7 +75,7 @@ onMounted(() => {
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
:public="true"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</q-card-section>
|
||||
</template>
|
||||
|
||||
@@ -22,13 +22,13 @@ export default {
|
||||
import {storeToRefs} from "pinia";
|
||||
import ContentCard from "components/ContentCard.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {useMeta, useQuasar} from "quasar";
|
||||
import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import {flightName} from "src/composables/flight";
|
||||
import {usePhotosStore} from "stores/Photos";
|
||||
import {onMounted, ref} from "vue";
|
||||
import {onMounted} from "vue";
|
||||
import PhotosEditorListSimple from "components/photos/PhotosEditorListSimple.vue";
|
||||
import {copilotBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
import {publicCopilotBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
import FlightFormPhotos from "components/flights/form/FlightFormPhotos.vue";
|
||||
import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||
import {useRoute} from "vue-router";
|
||||
@@ -47,7 +47,7 @@ const {photos, isQueryRunning: arePhotosLoading} = storeToRefs(usePhotosStore())
|
||||
|
||||
useAppStore().setPageTitle(`Nahraj fotky - ${props.pilot.name} - ${flightName(flight.value)}`);
|
||||
useAppStore().setBreadcrumbs([
|
||||
...copilotBreadcrumbs(props.pilot, flight.value, flight.value.event, copilot.value),
|
||||
...publicCopilotBreadcrumbs(props.pilot, flight.value, flight.value.event, copilot.value),
|
||||
{label: "Nahraj fotky"},
|
||||
]);
|
||||
|
||||
|
||||
@@ -20,6 +20,8 @@ import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import EventBasicInfo from "components/event/EventBasicInfo.vue";
|
||||
import EventFlightsMap from "components/event/EventFlightsMap.vue";
|
||||
import {publicEventBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
import {onMounted} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
pilot: {
|
||||
@@ -31,23 +33,18 @@ const props = defineProps({
|
||||
const {isQueryRunning, event} = storeToRefs(useEventsStore());
|
||||
|
||||
useAppStore().setPageTitle(event.value.name);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: "publicProfileDetail", params: {username: props.pilot.publicUsername}}, label: `@${props.pilot.publicUsername}`},
|
||||
{to: {name: "publicEventsList", params: {username: props.pilot.publicUsername}}, label: "Události"},
|
||||
{label: event.value.name}
|
||||
]);
|
||||
useAppStore().setBreadcrumbs(publicEventBreadcrumbs(props.pilot, event.value, false));
|
||||
useMeta(() => metaData({
|
||||
title: event.value.name,
|
||||
description: event.value.description
|
||||
}))
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetchPublic});
|
||||
filters.value = {username: props.pilot.publicUsername, eventId: event.value.id};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetchPublic, appendItems
|
||||
});
|
||||
loadNextFlightsPage(false);
|
||||
|
||||
onMounted(() => {
|
||||
loadPage(false);
|
||||
})
|
||||
|
||||
const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRefs(useFlightsStore());
|
||||
</script>
|
||||
@@ -80,7 +77,7 @@ const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRef
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
:public="true"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@ import {useEventsStore} from "stores/Events";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {useMeta} from "quasar";
|
||||
import {commonKeywords, metaData} from "src/composables/meta";
|
||||
import {publicProfileBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
const props = defineProps({
|
||||
pilot: {
|
||||
@@ -23,8 +24,7 @@ useMeta(() => metaData({
|
||||
|
||||
useAppStore().setPageTitle(`${props.pilot.publicUsername}`);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: "publicProfileDetail", params: {username: props.pilot.publicUsername}}, label: `@${props.pilot.publicUsername}`},
|
||||
...publicProfileBreadcrumbs(props.pilot),
|
||||
{label: "Události"}
|
||||
]);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import {aircraftKeywords, flightEventKeywords, flightKeywords, metaData} from "s
|
||||
import ContentCard from "components/ContentCard.vue";
|
||||
import {usePhotosStore} from "stores/Photos";
|
||||
import {computed} from "vue";
|
||||
import {publicFlightBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
const {isQueryRunning, flight} = storeToRefs(useFlightsStore());
|
||||
|
||||
@@ -37,24 +38,10 @@ usePhotosStore().fetchPublic({flightId: flight.value.id});
|
||||
const {isQueryRunning: arePhotosLoading, photos: flightPhotos} = storeToRefs(usePhotosStore());
|
||||
|
||||
const flightNameFormatted = flightName(flight.value);
|
||||
useAppStore().setPageTitle(flightNameFormatted);
|
||||
|
||||
const event = computed(() => flight.value.event);
|
||||
const breadcrumbs = [
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: "publicProfileDetail", params: {username: props.pilot.publicUsername}}, label: `@${props.pilot.publicUsername}`},
|
||||
]
|
||||
if (event.value && event.value.isPublic) {
|
||||
breadcrumbs.push({to: {name: 'publicEventsList', username: props.pilot.publicUsername}, label: "Události"});
|
||||
breadcrumbs.push({
|
||||
to: {
|
||||
name: 'publicEventDetail',
|
||||
params: {eventSlug: event.value.urlSlug, username: props.pilot.publicUsername}
|
||||
}, label: event.value.name
|
||||
});
|
||||
}
|
||||
breadcrumbs.push({label: flightNameFormatted})
|
||||
useAppStore().setBreadcrumbs(breadcrumbs);
|
||||
|
||||
useAppStore().setPageTitle(flightNameFormatted);
|
||||
useAppStore().setBreadcrumbs(publicFlightBreadcrumbs(props.pilot, flight.value, event.value, false));
|
||||
|
||||
useMeta(() => metaData({
|
||||
title: `${flightNameFormatted} - ${props.pilot.name}`,
|
||||
|
||||
@@ -8,6 +8,8 @@ import {storeToRefs} from "pinia";
|
||||
import {commonKeywords, metaData} from "src/composables/meta";
|
||||
import {useMeta} from "quasar";
|
||||
import {usePagination} from "src/composables/pagination";
|
||||
import {publicProfileBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
import {onMounted} from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
pilot: {
|
||||
@@ -24,18 +26,13 @@ useMeta(() => metaData({
|
||||
}));
|
||||
|
||||
useAppStore().setPageTitle(props.pilot.publicUsername);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{label: `@${props.pilot.publicUsername}`},
|
||||
])
|
||||
useAppStore().setBreadcrumbs(publicProfileBreadcrumbs(props.pilot, false))
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetchPublic});
|
||||
filters.value = {username: props.pilot.publicUsername};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetchPublic,
|
||||
appendItems
|
||||
onMounted(() => {
|
||||
loadPage(false);
|
||||
});
|
||||
loadNextFlightsPage(false);
|
||||
|
||||
const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRefs(useFlightsStore());
|
||||
</script>
|
||||
@@ -56,6 +53,6 @@ const {flights, totalItemsCount, isQueryRunning: areFlightsLoading} = storeToRef
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
:public="true"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -24,6 +24,7 @@ import BasicInfoBanner from "components/banners/BasicInfoBanner.vue";
|
||||
import {onMounted} from "vue";
|
||||
import PhotoGallerySkeleton from "components/photos/skeletons/PhotoGallerySkeleton.vue";
|
||||
import {usePagination} from "src/composables/pagination";
|
||||
import {publicPOIBaseBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
const {pointOfInterest, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
|
||||
const {photos, isQueryRunning: arePhotosLoading} = storeToRefs(usePhotosStore());
|
||||
@@ -36,23 +37,16 @@ useMeta(() => metaData({
|
||||
description: pointOfInterest.value.description,
|
||||
}));
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: 'publicPOIs'}, label: "Místa"},
|
||||
...publicPOIBaseBreadcrumbs(),
|
||||
{label: pointOfInterest.value.name}
|
||||
]);
|
||||
|
||||
const {filters, loadPage, paginationLimit} = usePagination();
|
||||
const {filters, loadPage, paginationLimit} = usePagination({fetchFunction: useFlightsStore().fetchPublic});
|
||||
filters.value = {pointOfInterestId: pointOfInterest.value.id};
|
||||
const loadNextFlightsPage = (appendItems) => loadPage({
|
||||
fetchFunc: useFlightsStore().fetchPublic,
|
||||
appendItems
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
usePhotosStore().fetchPublic({pointOfInterestId: pointOfInterest.value.id});
|
||||
loadNextFlightsPage(false);
|
||||
loadPage(false);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -85,7 +79,7 @@ onMounted(() => {
|
||||
:is-query-running="areFlightsLoading"
|
||||
:items-per-page="paginationLimit"
|
||||
:public="true"
|
||||
@load-more="loadNextFlightsPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</q-card-section>
|
||||
</template>
|
||||
|
||||
@@ -8,26 +8,23 @@ import {useMeta} from "quasar";
|
||||
import {metaData} from "src/composables/meta";
|
||||
import {usePagination} from "src/composables/pagination";
|
||||
import ListFilters from "components/ListFilters.vue";
|
||||
import {homepageBreadcrumbs, publicPOIBaseBreadcrumbs} from "src/composables/breadcrumbs";
|
||||
|
||||
useAppStore().setPageTitle("Místa");
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{label: "Místa"},
|
||||
]);
|
||||
useAppStore().setBreadcrumbs(publicPOIBaseBreadcrumbs());
|
||||
useMeta(() => metaData({
|
||||
title: "Místa"
|
||||
}))
|
||||
|
||||
const {filters, loadPage, paginationOffset, paginationLimit} = usePagination();
|
||||
const loadNextPage = (appendItems) => loadPage({
|
||||
fetchFunc: usePointsOfInterestStore().fetchPublic, appendItems
|
||||
const {filters, loadPage, paginationOffset, paginationLimit} = usePagination({
|
||||
fetchFunction: usePointsOfInterestStore().fetchPublic
|
||||
});
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
|
||||
const handleFiltersChanged = (newFilters) => {
|
||||
paginationOffset.value = 0;
|
||||
filters.value = newFilters;
|
||||
loadNextPage(false);
|
||||
loadPage(false);
|
||||
}
|
||||
|
||||
const {pointsOfInterest, totalItemsCount, isQueryRunning} = storeToRefs(usePointsOfInterestStore());
|
||||
@@ -45,7 +42,7 @@ const {pointsOfInterest, totalItemsCount, isQueryRunning} = storeToRefs(usePoint
|
||||
:total-items-count="totalItemsCount"
|
||||
:is-query-running="isQueryRunning"
|
||||
:items-per-page="paginationLimit"
|
||||
@load-more="loadNextPage(true)"
|
||||
@load-more="loadPage(true)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -15,6 +15,7 @@ const $q = useQuasar();
|
||||
useAppStore().setPageTitle("Zapomenuté heslo");
|
||||
useMeta(() => metaData({
|
||||
title: "Zapomenuté heslo",
|
||||
index: false
|
||||
}));
|
||||
|
||||
const requestPasswordChange = () => {
|
||||
|
||||
@@ -14,6 +14,7 @@ const $q = useQuasar();
|
||||
useAppStore().setPageTitle("Přihlášení");
|
||||
useMeta(() => metaData({
|
||||
title: "Přihlášení",
|
||||
index: false
|
||||
}));
|
||||
|
||||
const logUser = () => {
|
||||
|
||||
@@ -17,6 +17,7 @@ const $q = useQuasar();
|
||||
useAppStore().setPageTitle("Změna hesla");
|
||||
useMeta(() => metaData({
|
||||
title: "Změna hesla",
|
||||
index: false
|
||||
}));
|
||||
|
||||
const tokenInfo = reactive({
|
||||
|
||||
Reference in New Issue
Block a user