diff --git a/package.json b/package.json index b66c629..c90b41d 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ "chart.js": "^4.4.0", "graphql": "16.6.0", "graphql-tag": "2.12.6", + "photoswipe": "^5.4.2", + "photoswipe-dynamic-caption-plugin": "^1.2.7", "pinia": "^2.0.33", "quasar": "^2.12.0", "vue": "^3.2.47", diff --git a/src/components/photos/PhotoCaption.vue b/src/components/photos/PhotoCaption.vue new file mode 100644 index 0000000..7593af8 --- /dev/null +++ b/src/components/photos/PhotoCaption.vue @@ -0,0 +1,63 @@ + + + diff --git a/src/components/photos/PhotoGallery.vue b/src/components/photos/PhotoGallery.vue new file mode 100644 index 0000000..ac46543 --- /dev/null +++ b/src/components/photos/PhotoGallery.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/components/photos/PhotosList.vue b/src/components/photos/PhotosEditorList.vue similarity index 86% rename from src/components/photos/PhotosList.vue rename to src/components/photos/PhotosEditorList.vue index c267597..047c164 100644 --- a/src/components/photos/PhotosList.vue +++ b/src/components/photos/PhotosEditorList.vue @@ -3,33 +3,29 @@ import {computed, onMounted, reactive, ref, watch} from "vue"; import {useQuasar} from "quasar"; import {confirmObject} from "src/composables/dialog"; +const $q = useQuasar(); + + const props = defineProps({ photos: { type: Array }, - showActions: { - type: Boolean, - required: false, - default: true - } }); const batchEdit = ref({}); - onMounted(() => { for (const photo of props.photos) { batchEdit.value[photo.id] = false; } }); -const emits = defineEmits(["edit", "delete", "batch-edit", "batch-rotate", "photo-click"]) +const emits = defineEmits(["edit", "delete", "batch-edit", "batch-rotate"]) const openEdit = (photo) => { emits("edit", photo); }; -const $q = useQuasar(); const confirmPhotoDelete = (id) => { $q.dialog(confirmObject("Opravdu chces smazat tuto fotku?")) @@ -50,11 +46,7 @@ const confirmBatchPhotoDelete = () => { } const handleImageClick = (photo, idx) => { - if (props.showActions) { - batchEdit.value[photo.id] = !batchEdit.value[photo.id]; - } else { - emits("photo-click", {photo, idx}); - } + batchEdit.value[photo.id] = !batchEdit.value[photo.id]; } const selectedPhotos = computed(() => { @@ -133,13 +125,10 @@ const batchOptionsProps = computed(() => ({ - +
- - -
@@ -149,7 +138,7 @@ const batchOptionsProps = computed(() => ({ - + diff --git a/src/pages/profile/flight/EditFlightPage.vue b/src/pages/profile/flight/EditFlightPage.vue index 02f0928..81ad012 100644 --- a/src/pages/profile/flight/EditFlightPage.vue +++ b/src/pages/profile/flight/EditFlightPage.vue @@ -15,7 +15,7 @@ import {useCopilotsStore} from "stores/Copilots"; import FlightFormNotes from "components/flights/form/FlightFormNotes.vue"; import FlightFormPhotos from "components/flights/form/FlightFormPhotos.vue"; import {usePhotosStore} from "stores/Photo"; -import PhotosList from "components/photos/PhotosList.vue"; +import PhotosList from "components/photos/PhotosEditorList.vue"; import {errorObject, successObject, warningObject} from "src/composables/dialog"; import PhotoFormDialog from "components/photos/PhotoFormDialog.vue"; import FlightFormTrack from "components/flights/form/FlightFormTrack.vue"; diff --git a/src/pages/profile/flight/FlightDetailPage.vue b/src/pages/profile/flight/FlightDetailPage.vue index 8ceadd3..a804079 100644 --- a/src/pages/profile/flight/FlightDetailPage.vue +++ b/src/pages/profile/flight/FlightDetailPage.vue @@ -1,6 +1,6 @@