Breadcrumbs resit pres funkce
This commit is contained in:
@@ -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}`,
|
||||
|
||||
Reference in New Issue
Block a user