diff --git a/README.md b/README.md index 3b48223..73aa31b 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ Hi! I'm Sean, the creator of AdventureLog. I'm a college student and software de ## 💎 Acknowledgements -- Logo Design by [nordtechtiger](https://github.com/nordtechtiger) +- Logo Design by [nordtektiger](https://github.com/nordtektiger) - WorldTravel Dataset [dr5hn/countries-states-cities-database](https://github.com/dr5hn/countries-states-cities-database) ### Top Supporters 💖 diff --git a/backend/server/integrations/views.py b/backend/server/integrations/views.py index ea4071a..e5540b9 100644 --- a/backend/server/integrations/views.py +++ b/backend/server/integrations/views.py @@ -270,23 +270,20 @@ class ImmichIntegrationView(viewsets.ViewSet): integration = get_object_or_404(ImmichIntegration, id=integration_id) owner_id = integration.user_id - # Try to find the image entry with collection and sharing information + # Try to find the image entry with collections and sharing information image_entry = ( AdventureImage.objects .filter(immich_id=imageid, user_id=owner_id) - .select_related('adventure', 'adventure__collection') - .prefetch_related('adventure__collection__shared_with') - .order_by( - '-adventure__is_public', # Public adventures first - '-adventure__collection__is_public' # Then public collections - ) + .select_related('adventure') + .prefetch_related('adventure__collections', 'adventure__collections__shared_with') + .order_by('-adventure__is_public') # Public adventures first .first() ) # Access control if image_entry: adventure = image_entry.adventure - collection = adventure.collection + collections = adventure.collections.all() # Determine access level is_authorized = False @@ -295,17 +292,18 @@ class ImmichIntegrationView(viewsets.ViewSet): if adventure.is_public: is_authorized = True - # Level 2: Private adventure in public collection - elif collection and collection.is_public: + # Level 2: Private adventure in any public collection + elif any(collection.is_public for collection in collections): is_authorized = True # Level 3: Owner access elif request.user.is_authenticated and request.user.id == owner_id: is_authorized = True - # Level 4: Shared collection access - elif (request.user.is_authenticated and collection and - collection.shared_with.filter(id=request.user.id).exists()): + # Level 4: Shared collection access - check if user has access to any collection + elif (request.user.is_authenticated and + any(collection.shared_with.filter(id=request.user.id).exists() + for collection in collections)): is_authorized = True if not is_authorized: diff --git a/frontend/package.json b/frontend/package.json index b0a09fb..95ff6c9 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,6 +14,7 @@ "devDependencies": { "@event-calendar/core": "^3.7.1", "@event-calendar/day-grid": "^3.7.1", + "@event-calendar/interaction": "^3.12.0", "@event-calendar/time-grid": "^3.7.1", "@iconify-json/mdi": "^1.1.67", "@sveltejs/adapter-node": "^5.2.0", diff --git a/frontend/pnpm-lock.yaml b/frontend/pnpm-lock.yaml index 3faf76d..aa4490a 100644 --- a/frontend/pnpm-lock.yaml +++ b/frontend/pnpm-lock.yaml @@ -48,6 +48,9 @@ importers: '@event-calendar/day-grid': specifier: ^3.7.1 version: 3.12.0 + '@event-calendar/interaction': + specifier: ^3.12.0 + version: 3.12.0 '@event-calendar/time-grid': specifier: ^3.7.1 version: 3.12.0 @@ -566,6 +569,9 @@ packages: '@event-calendar/day-grid@3.12.0': resolution: {integrity: sha512-gY6XvEIlwWI9uKWsXukyanDmrEWv1UDHdhikhchpe6iZP25p3+760qXIU2kdu91tXjb+hVbpFcn7sdNPPE4u7Q==} + '@event-calendar/interaction@3.12.0': + resolution: {integrity: sha512-+d3KqxNdcY/RfJrdai37XCoTx7KKpzqJIo/WAjH1p8ZiypsfrHgpWWuTtF76u3hpn/1qqWUM3VFJSTKbjJkWTg==} + '@event-calendar/time-grid@3.12.0': resolution: {integrity: sha512-n/IoFSq/ym6ad2k+H9RL2A8GpfOJy1zpKKLb1Edp/QEusexpPg8LNdSbxhmKGz6ip5ud0Bi/xgUa8xUqut8ooQ==} @@ -2405,6 +2411,11 @@ snapshots: '@event-calendar/core': 3.12.0 svelte: 4.2.19 + '@event-calendar/interaction@3.12.0': + dependencies: + '@event-calendar/core': 3.12.0 + svelte: 4.2.19 + '@event-calendar/time-grid@3.12.0': dependencies: '@event-calendar/core': 3.12.0 diff --git a/frontend/src/lib/components/AdventureLink.svelte b/frontend/src/lib/components/AdventureLink.svelte index 4210170..d967093 100644 --- a/frontend/src/lib/components/AdventureLink.svelte +++ b/frontend/src/lib/components/AdventureLink.svelte @@ -12,8 +12,6 @@ import Search from '~icons/mdi/magnify'; import Clear from '~icons/mdi/close'; import Link from '~icons/mdi/link-variant'; - import Filter from '~icons/mdi/filter-variant'; - import Calendar from '~icons/mdi/calendar'; import Check from '~icons/mdi/check-circle'; import Cancel from '~icons/mdi/cancel'; import Public from '~icons/mdi/earth'; diff --git a/frontend/src/lib/components/AdventureModal.svelte b/frontend/src/lib/components/AdventureModal.svelte index c097871..504a360 100644 --- a/frontend/src/lib/components/AdventureModal.svelte +++ b/frontend/src/lib/components/AdventureModal.svelte @@ -456,6 +456,11 @@ } } + // add this collection to the adventure + if (collection && collection.id) { + adventure.collections = [collection.id]; + } + let res = await fetch('/api/adventures', { method: 'POST', headers: { diff --git a/frontend/src/lib/components/CollectionAllView.svelte b/frontend/src/lib/components/CollectionAllView.svelte new file mode 100644 index 0000000..17d28c1 --- /dev/null +++ b/frontend/src/lib/components/CollectionAllView.svelte @@ -0,0 +1,551 @@ + + + +
+ {totalItems} + {$t('worldtravel.total_items')} +
+- {formatDateInTimezone(lodging.check_in, lodging.timezone)} – - {formatDateInTimezone(lodging.check_out, lodging.timezone)} - {#if lodging.timezone} - ({lodging.timezone}) - {/if} -
-+ {filteredDates.length} + {$t('calendar.events_scheduled')} +
+