diff --git a/backend/server/adventures/views/import_export_view.py b/backend/server/adventures/views/import_export_view.py index db4cd36..7212bd9 100644 --- a/backend/server/adventures/views/import_export_view.py +++ b/backend/server/adventures/views/import_export_view.py @@ -14,6 +14,7 @@ from rest_framework.decorators import action from rest_framework.response import Response from rest_framework.parsers import MultiPartParser from rest_framework.permissions import IsAuthenticated +from django.conf import settings from adventures.models import ( Location, Collection, Transportation, Note, Checklist, ChecklistItem, @@ -38,9 +39,10 @@ class BackupViewSet(viewsets.ViewSet): # Build export data structure export_data = { - 'version': '1.0', + 'version': settings.ADVENTURELOG_RELEASE_VERSION, 'export_date': datetime.now().isoformat(), 'user_email': user.email, + 'user_username': user.username, 'categories': [], 'collections': [], 'locations': [], @@ -83,7 +85,7 @@ class BackupViewSet(viewsets.ViewSet): 'end_date': collection.end_date.isoformat() if collection.end_date else None, 'is_archived': collection.is_archived, 'link': collection.link, - 'shared_with_emails': list(collection.shared_with.values_list('email', flat=True)) + 'shared_with_user_ids': [str(uuid) for uuid in collection.shared_with.values_list('uuid', flat=True)] }) # Create collection name to export_id mapping @@ -416,10 +418,11 @@ class BackupViewSet(viewsets.ViewSet): summary['collections'] += 1 # Handle shared users - for email in col_data.get('shared_with_emails', []): + for uuid in col_data.get('shared_with_user_ids', []): try: - shared_user = User.objects.get(email=email) - collection.shared_with.add(shared_user) + shared_user = User.objects.get(uuid=uuid) + if shared_user.public_profile: + collection.shared_with.add(shared_user) except User.DoesNotExist: pass diff --git a/backend/server/main/settings.py b/backend/server/main/settings.py index f707af4..339c8f4 100644 --- a/backend/server/main/settings.py +++ b/backend/server/main/settings.py @@ -326,6 +326,9 @@ LOGGING = { # ADVENTURELOG_CDN_URL = getenv('ADVENTURELOG_CDN_URL', 'https://cdn.adventurelog.app') +# Major release version of AdventureLog, not including the patch version date. +ADVENTURELOG_RELEASE_VERSION = 'v0.10.0' + # https://github.com/dr5hn/countries-states-cities-database/tags COUNTRY_REGION_JSON_VERSION = 'v2.6' diff --git a/frontend/src/lib/components/CardCarousel.svelte b/frontend/src/lib/components/CardCarousel.svelte index 8b98787..3616d35 100644 --- a/frontend/src/lib/components/CardCarousel.svelte +++ b/frontend/src/lib/components/CardCarousel.svelte @@ -6,7 +6,8 @@ export let adventures: Location[] = []; let currentSlide = 0; - let image_url: string | null = null; + let showImageModal = false; + let modalInitialIndex = 0; $: adventure_images = adventures.flatMap((adventure) => adventure.images.map((image) => ({ @@ -42,13 +43,22 @@ currentSlide = currentSlide - 1; } } + + function openImageModal(initialIndex: number = currentSlide) { + modalInitialIndex = initialIndex; + showImageModal = true; + } + + function closeImageModal() { + showImageModal = false; + } -{#if image_url} +{#if showImageModal && adventure_images.length > 0} (image_url = null)} + images={adventure_images} + initialIndex={modalInitialIndex} + on:close={closeImageModal} /> {/if} @@ -61,14 +71,46 @@ (image_url = adventure_images[currentSlide].image)} - class="cursor-pointer" + on:click|stopPropagation={() => openImageModal(currentSlide)} + class="cursor-pointer relative group" > {adventure_images[currentSlide].adventure.name} + + + {#if adventure_images.length > 1} +
+ {currentSlide + 1} / {adventure_images.length} +
+ {/if} + + +
{#if adventure_images.length > 1} @@ -76,8 +118,18 @@ {#if currentSlide > 0} + + + + {:else}
{/if} @@ -85,17 +137,43 @@ {#if currentSlide < adventure_images.length - 1} + + + + {:else}
{/if} + + + {#if adventure_images.length > 1} +
+ {#each adventure_images as _, index} +
+ {/if} {/if} {:else} - +
- - + -