Merge branch 'master' of kvacek.cz:poletani.cz/app into ssr
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
<div class="col col-md-6">
|
||||
<div class="info-box bg-semi-transparent q-mx-lg q-py-lg q-px-lg rounded-borders">
|
||||
<div class="text-h2 text-center">Pochlub se polétáním</div>
|
||||
<div class="text-h3 text-center">Pochlub se polétáním</div>
|
||||
|
||||
<q-timeline color="primary" class="q-my-lg">
|
||||
<q-timeline-entry title="Zaznamenej si let">
|
||||
@@ -59,9 +59,9 @@
|
||||
</q-timeline-entry>
|
||||
</q-timeline>
|
||||
|
||||
<div class="text-center q-my-lg">
|
||||
<q-btn size="xl" :to="{name: 'registration'}" rounded color="secondary">Založit profil</q-btn>
|
||||
</div>
|
||||
<div class="text-center q-my-lg">
|
||||
<q-btn size="xl" :to="{name: 'registration'}" rounded color="secondary">Založit profil</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
<script setup>
|
||||
import {useRoute} from "vue-router";
|
||||
import {user as pilot, loading as pilotLoading} from "src/composables/objects/user";
|
||||
import PublicProfileSkeleton from "components/profile/PublicProfileSkeleton.vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {useUserStore} from "stores/User";
|
||||
import PilotProfileCard from "components/profile/PilotProfileCard.vue";
|
||||
import {onMounted} from "vue";
|
||||
|
||||
const loggedUser = storeToRefs(useUserStore()).user;
|
||||
const username = useRoute().params.username;
|
||||
|
||||
const {publicUser: pilot, isQueryRunning: pilotLoading} = storeToRefs(useUserStore());
|
||||
|
||||
onMounted(() => {
|
||||
useUserStore().fetchPublicUserDetail(username);
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -16,7 +22,7 @@ const username = useRoute().params.username;
|
||||
<router-view :logged-user="loggedUser" :username="username"/>
|
||||
</div>
|
||||
<div class="col-12 col-md-4">
|
||||
<PublicProfileSkeleton v-if="pilotLoading"/>
|
||||
<PublicProfileSkeleton v-if="pilotLoading || !pilot"/>
|
||||
<PilotProfileCard v-else :pilot="pilot"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<script setup>
|
||||
import {useRoute} from "vue-router";
|
||||
import {copilot, fetchCopilot, loading as copilotLoading} from "src/composables/objects/copilot";
|
||||
import {fetchUser, user as pilot, loading as pilotLoading} from "src/composables/objects/user";
|
||||
import {onMounted} from "vue";
|
||||
import FlightsList from "components/flights/FlightsList.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import BasicListSkeleton from "components/basicSkeletons/BasicListSkeleton.vue";
|
||||
import {useUserStore} from "stores/User";
|
||||
import {useCopilotsStore} from "stores/Copilots";
|
||||
import {storeToRefs} from "pinia";
|
||||
|
||||
const $route = useRoute();
|
||||
const copilotId = parseInt($route.params.id);
|
||||
@@ -22,17 +23,19 @@ const props = defineProps({
|
||||
}
|
||||
});
|
||||
|
||||
const {copilot, isQueryRunning} = storeToRefs(useCopilotsStore());
|
||||
const {publicUser, isQueryRunning: isPilotQueryRunning} = storeToRefs(useUserStore());
|
||||
|
||||
onMounted(() => {
|
||||
Promise.all([
|
||||
fetchUser(props.username),
|
||||
fetchCopilot(copilotId, props.username)
|
||||
useUserStore().fetchPublicUserDetail(props.username),
|
||||
useCopilotsStore().fetchDetail(copilotId, props.username)
|
||||
]).then(() => {
|
||||
useAppStore().setPageTitle(`${pilot.value.name} + ${copilot.value.name}`);
|
||||
useAppStore().setPageTitle(`${publicUser.value.name} + ${copilot.value.name}`);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: "publicProfileDetail", params: {username: props.username}}, label: `@${props.username}`},
|
||||
{label: pilot.value.name}
|
||||
{label: publicUser.value.name}
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -40,7 +43,7 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicListSkeleton v-if="copilotLoading || pilotLoading" class="q-mb-md"/>
|
||||
<BasicListSkeleton v-if="isQueryRunning || isPilotQueryRunning || !copilot" class="q-mb-md"/>
|
||||
|
||||
<template v-else>
|
||||
<h3>Společné lety</h3>
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
<script setup>
|
||||
import {onMounted, watch} from "vue";
|
||||
import {event, fetchEvent, loading} from "src/composables/objects/event";
|
||||
import {useRoute} from "vue-router";
|
||||
import {useAppStore} from "stores/App";
|
||||
import FlightDetailSkeleton from "components/flights/FlightDetailSkeleton.vue";
|
||||
import {fetchUser, loading as pilotLoading, user as pilot} from "src/composables/objects/user";
|
||||
import PublicProfileSkeleton from "components/profile/PublicProfileSkeleton.vue";
|
||||
import PilotProfileCard from "components/profile/PilotProfileCard.vue";
|
||||
import EventDetailSkeleton from "components/event/EventDetailSkeleton.vue";
|
||||
import {FORMAT_DATE, formatDatetime} from "src/composables/datetimeUtils";
|
||||
import FAB from "components/FAB.vue";
|
||||
import FlightsList from "components/flights/FlightsList.vue";
|
||||
import {useEventsStore} from "stores/Events";
|
||||
import {useUserStore} from "stores/User";
|
||||
import {storeToRefs} from "pinia";
|
||||
|
||||
const routeParams = useRoute().params;
|
||||
onMounted(() => {
|
||||
fetchEvent(routeParams.id, routeParams.username);
|
||||
fetchUser(routeParams.username)
|
||||
useEventsStore().fetchDetail(routeParams.id, routeParams.username);
|
||||
useUserStore().fetchPublicUserDetail(routeParams.username);
|
||||
})
|
||||
|
||||
watch(event, (newVal) => {
|
||||
// const eventNameFormatted = eventName(newVal);
|
||||
const {isQueryRunning, event} = storeToRefs(useEventsStore());
|
||||
|
||||
watch(() => event.value, (newVal) => {
|
||||
useAppStore().setPageTitle(newVal.name);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
@@ -33,8 +31,7 @@ watch(event, (newVal) => {
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<EventDetailSkeleton v-if="loading || !event"/>
|
||||
|
||||
<EventDetailSkeleton v-if="isQueryRunning || !event"/>
|
||||
|
||||
<template v-else>
|
||||
<q-banner class="bg-warning text-white q-mx-md q-my-md" v-if="!event.isPublic">
|
||||
@@ -66,6 +63,7 @@ watch(event, (newVal) => {
|
||||
<FlightsList
|
||||
v-else
|
||||
:items="event.flights"
|
||||
class="q-my-lg"
|
||||
:route-detail="{name: 'publicFlightDetail', params: {username: routeParams.username}}"
|
||||
/>
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script setup>
|
||||
import FlightsListSkeleton from "components/flights/FlightsListSkeleton.vue";
|
||||
import {event, events, fetchEvents, loading} from "src/composables/objects/event";
|
||||
import EventsList from "components/event/EventsList.vue";
|
||||
import {onMounted, watch} from "vue";
|
||||
import PublicFlightEventSwitcher from "components/navigation/PublicFlightEventSwitcher.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {useEventsStore} from "stores/Events";
|
||||
import {storeToRefs} from "pinia";
|
||||
|
||||
const props = defineProps({
|
||||
loggedUser: {
|
||||
@@ -28,20 +29,19 @@ onMounted(() => {
|
||||
{to: {name: "publicProfileDetail", params: {username: props.username}}, label: `@${props.username}`},
|
||||
{label: "Události"}
|
||||
]);
|
||||
fetchEvents(props.username);
|
||||
useEventsStore().fetch(props.username);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
const {isQueryRunning, events} = storeToRefs(useEventsStore());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PublicFlightEventSwitcher :username="username"/>
|
||||
|
||||
<FlightsListSkeleton v-if="loading"/>
|
||||
<FlightsListSkeleton v-if="isQueryRunning"/>
|
||||
|
||||
|
||||
<q-banner class="bg-primary text-white" v-else-if="!loading && events.length === 0">
|
||||
<q-banner class="bg-primary text-white" v-else-if="!isQueryRunning && events.length === 0">
|
||||
Tento pilot zatím nepublikoval žádnou udalost.
|
||||
</q-banner>
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
<script setup>
|
||||
import {onMounted, watch} from "vue";
|
||||
import {fetchFlight, flight, flightName, loading} from "src/composables/objects/flight";
|
||||
import {useRoute} from "vue-router";
|
||||
import FlightTrackMap from "components/flights/FlightTrackMap.vue";
|
||||
import FlightBasicInfo from "components/flights/FlightBasicInfo.vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import FlightDetailSkeleton from "components/flights/FlightDetailSkeleton.vue";
|
||||
import {fetchUser, loading as pilotLoading, user as pilot} from "src/composables/objects/user";
|
||||
import PhotoGallery from "components/photos/PhotoGallery.vue";
|
||||
import {storeToRefs} from "pinia";
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
import {flightName} from "src/composables/flight";
|
||||
|
||||
const routeParams = useRoute().params;
|
||||
onMounted(() => {
|
||||
fetchFlight(routeParams.id, routeParams.username);
|
||||
fetchUser(routeParams.username)
|
||||
useFlightsStore().fetchDetail(routeParams.id, routeParams.username).then(f => {
|
||||
const flightNameFormatted = flightName(f);
|
||||
useAppStore().setPageTitle(flightNameFormatted);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: "publicProfileDetail", params: {username: routeParams.username}}, label: `@${routeParams.username}`},
|
||||
{label: flightNameFormatted}
|
||||
]);
|
||||
})
|
||||
})
|
||||
|
||||
watch(flight, (newVal) => {
|
||||
const flightNameFormatted = flightName(newVal);
|
||||
useAppStore().setPageTitle(flightNameFormatted);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{to: {name: "publicProfileDetail", params: {username: routeParams.username}}, label: `@${routeParams.username}`},
|
||||
{label: flightNameFormatted}
|
||||
]);
|
||||
});
|
||||
const {isQueryRunning, flight} = storeToRefs(useFlightsStore());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<FlightDetailSkeleton v-if="loading || !flight"/>
|
||||
<FlightDetailSkeleton v-if="isQueryRunning || !flight"/>
|
||||
|
||||
<template v-else>
|
||||
<q-banner class="bg-warning text-white q-mx-md q-my-md" v-if="!flight.isPublic">
|
||||
@@ -44,8 +44,8 @@ watch(flight, (newVal) => {
|
||||
|
||||
<q-card-section>
|
||||
<FlightBasicInfo
|
||||
:flight="flight"
|
||||
:copilot-detail-route="{name: 'publicCopilotDetail', params: {username: routeParams.username}}"
|
||||
:flight="flight"
|
||||
:copilot-detail-route="{name: 'publicCopilotDetail', params: {username: routeParams.username}}"
|
||||
/>
|
||||
|
||||
<article class="q-my-lg" v-html="flight.description"/>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<script setup>
|
||||
import {fetchFlights, flights, loading as flightsLoading} from "src/composables/objects/flight";
|
||||
import {fetchUser, user as pilot} from "src/composables/objects/user";
|
||||
import FlightsListSkeleton from "components/flights/FlightsListSkeleton.vue";
|
||||
import FlightsList from "components/flights/FlightsList.vue";
|
||||
import PublicFlightEventSwitcher from "components/navigation/PublicFlightEventSwitcher.vue";
|
||||
import {onMounted} from "vue";
|
||||
import {useAppStore} from "stores/App";
|
||||
import {useUserStore} from "stores/User";
|
||||
import {useFlightsStore} from "stores/Flights";
|
||||
import {storeToRefs} from "pinia";
|
||||
|
||||
const props = defineProps({
|
||||
loggedUser: {
|
||||
@@ -20,23 +21,27 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
fetchUser(props.username).then(user => {
|
||||
useUserStore().fetchPublicUserDetail(props.username).then(user => {
|
||||
useAppStore().setPageTitle(user.publicUsername);
|
||||
useAppStore().setBreadcrumbs([
|
||||
{to: {name: 'homepage'}, label: "Polétání.cz"},
|
||||
{label: `@${user.publicUsername}`},
|
||||
])
|
||||
})
|
||||
fetchFlights(props.username);
|
||||
})
|
||||
|
||||
useFlightsStore().fetch(props.username);
|
||||
});
|
||||
|
||||
const {flights, isQueryRunning: areFlightsLoading} = storeToRefs(useFlightsStore());
|
||||
const {publicUser: pilot} = storeToRefs(useUserStore());
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<PublicFlightEventSwitcher :username="username" />
|
||||
|
||||
<FlightsListSkeleton v-if="flightsLoading"/>
|
||||
<FlightsListSkeleton v-if="areFlightsLoading"/>
|
||||
|
||||
<q-banner class="bg-primary text-white" v-else-if="!flightsLoading && flights.length === 0">
|
||||
<q-banner class="bg-primary text-white" v-else-if="!areFlightsLoading && flights.length === 0">
|
||||
Tento pilot zatím nepublikoval žádný let.
|
||||
</q-banner>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user