diff --git a/frontend/src/lib/components/CardCarousel.svelte b/frontend/src/lib/components/CardCarousel.svelte index f855aec..49e62ca 100644 --- a/frontend/src/lib/components/CardCarousel.svelte +++ b/frontend/src/lib/components/CardCarousel.svelte @@ -1,43 +1,33 @@ -{#if showImageModal && adventure_images.length > 0} +{#if showImageModal && sortedImages.length > 0} {/if} - {#if adventure_images && adventure_images.length > 0} + {#if sortedImages && sortedImages.length > 0} @@ -75,17 +66,17 @@ class="cursor-pointer relative group" > - @@ -113,7 +104,7 @@ --> - {#if adventure_images.length > 1} + {#if sortedImages.length > 1} {#if currentSlide > 0} {/if} - {#if currentSlide < adventure_images.length - 1} + {#if currentSlide < sortedImages.length - 1} changeSlide('next')} class="btn btn-circle btn-sm mr-2 pointer-events-auto bg-neutral border-none text-neutral-content shadow-lg" @@ -155,9 +146,9 @@ - - - + + + {#if icon} + + + + {icon} + + + {:else} + + + {/if} {/if} diff --git a/frontend/src/lib/components/CollectionCard.svelte b/frontend/src/lib/components/CollectionCard.svelte index 0e68240..d2781d6 100644 --- a/frontend/src/lib/components/CollectionCard.svelte +++ b/frontend/src/lib/components/CollectionCard.svelte @@ -91,7 +91,11 @@ > - + location.images)} + name={collection.name} + icon="📚" + /> diff --git a/frontend/src/lib/components/ImageDisplayModal.svelte b/frontend/src/lib/components/ImageDisplayModal.svelte index 8f9d55d..ea08011 100644 --- a/frontend/src/lib/components/ImageDisplayModal.svelte +++ b/frontend/src/lib/components/ImageDisplayModal.svelte @@ -3,15 +3,15 @@ const dispatch = createEventDispatcher(); import { onMount } from 'svelte'; let modal: HTMLDialogElement; - import type { Location } from '$lib/types'; - - export let images: { image: string; adventure: any | null }[] = []; - export let initialIndex: number = 0; import { t } from 'svelte-i18n'; + import type { ContentImage } from '$lib/types'; + export let images: ContentImage[] = []; + export let initialIndex: number = 0; + export let name: string = ''; + export let location: string = ''; let currentIndex = initialIndex; let currentImage = images[currentIndex]?.image || ''; - let currentAdventure = images[currentIndex]?.adventure || null; onMount(() => { modal = document.getElementById('my_modal_1') as HTMLDialogElement; @@ -48,7 +48,6 @@ function updateCurrentSlide(index: number) { currentIndex = index; currentImage = images[currentIndex]?.image || ''; - currentAdventure = images[currentIndex]?.adventure || null; } function nextSlide() { @@ -86,7 +85,7 @@ on:keydown={handleKeydown} tabindex="0" > - {#if currentAdventure && currentImage} + {#if images.length > 0 && currentImage} - {currentAdventure.name} + {name} {#if images.length > 1} @@ -174,7 +173,7 @@ @@ -210,11 +209,7 @@ : 'border-base-300 hover:border-base-400'}" on:click={() => goToSlide(index)} > - + {/each} @@ -227,7 +222,7 @@ > - {#if currentAdventure.location} + {#if location} - {currentAdventure.location} + {location} {/if} diff --git a/frontend/src/lib/components/LocationCard.svelte b/frontend/src/lib/components/LocationCard.svelte index 01feb8b..a7480c3 100644 --- a/frontend/src/lib/components/LocationCard.svelte +++ b/frontend/src/lib/components/LocationCard.svelte @@ -190,7 +190,7 @@ > - + diff --git a/frontend/src/lib/components/LodgingCard.svelte b/frontend/src/lib/components/LodgingCard.svelte index bc4ca21..1baeb1e 100644 --- a/frontend/src/lib/components/LodgingCard.svelte +++ b/frontend/src/lib/components/LodgingCard.svelte @@ -99,7 +99,7 @@ > - + {#if lodging.type} diff --git a/frontend/src/lib/components/TransportationCard.svelte b/frontend/src/lib/components/TransportationCard.svelte index 07b0e9a..f541878 100644 --- a/frontend/src/lib/components/TransportationCard.svelte +++ b/frontend/src/lib/components/TransportationCard.svelte @@ -118,7 +118,11 @@ > - + diff --git a/frontend/src/routes/collections/[id]/+page.svelte b/frontend/src/routes/collections/[id]/+page.svelte index 65cb0b4..947f49b 100644 --- a/frontend/src/routes/collections/[id]/+page.svelte +++ b/frontend/src/routes/collections/[id]/+page.svelte @@ -1224,7 +1224,7 @@ {/if} - {#if orderedItem.type === 'adventure' && orderedItem.item && 'images' in orderedItem.item} + {#if orderedItem.type === 'adventure' && orderedItem.item && 'visits' in orderedItem.item} (isPopupOpen = false)}> {#if adventure.images && adventure.images.length > 0} - + {/if} {adventure.name} diff --git a/frontend/src/routes/map/+page.svelte b/frontend/src/routes/map/+page.svelte index 15defc8..a895260 100644 --- a/frontend/src/routes/map/+page.svelte +++ b/frontend/src/routes/map/+page.svelte @@ -208,7 +208,11 @@ {#if adventure.images && adventure.images.length > 0} - + {/if}
@@ -174,7 +173,7 @@
diff --git a/frontend/src/routes/map/+page.svelte b/frontend/src/routes/map/+page.svelte index 15defc8..a895260 100644 --- a/frontend/src/routes/map/+page.svelte +++ b/frontend/src/routes/map/+page.svelte @@ -208,7 +208,11 @@