From 93a489a778dd67da849133d5e44c99b85a688f6b Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Wed, 18 Jun 2025 14:05:39 -0400 Subject: [PATCH 1/2] feat: add CollectionAllView component for unified display of adventures, transportations, lodging, notes, and checklists with filtering and sorting capabilities i18n: update translations for collection contents and sorting options in multiple languages refactor: replace individual sections for adventures, transportations, lodging, notes, and checklists in the collection page with the new CollectionAllView component --- .../lib/components/CollectionAllView.svelte | 568 ++++++++++++++++++ frontend/src/locales/de.json | 10 +- frontend/src/locales/en.json | 8 +- frontend/src/locales/es.json | 10 +- frontend/src/locales/fr.json | 10 +- frontend/src/locales/it.json | 10 +- frontend/src/locales/ko.json | 10 +- frontend/src/locales/nl.json | 10 +- frontend/src/locales/no.json | 10 +- frontend/src/locales/pl.json | 10 +- frontend/src/locales/ru.json | 10 +- frontend/src/locales/sv.json | 10 +- frontend/src/locales/zh.json | 10 +- .../src/routes/collections/[id]/+page.svelte | 130 ++-- 14 files changed, 698 insertions(+), 118 deletions(-) create mode 100644 frontend/src/lib/components/CollectionAllView.svelte diff --git a/frontend/src/lib/components/CollectionAllView.svelte b/frontend/src/lib/components/CollectionAllView.svelte new file mode 100644 index 0000000..4368c4c --- /dev/null +++ b/frontend/src/lib/components/CollectionAllView.svelte @@ -0,0 +1,568 @@ + + + +
+ +
+
+
+ +
+
+

+ {$t('adventures.collection_contents')} +

+

+ {totalItems} + {$t('worldtravel.total_items')} +

+
+
+ + + +
+ + +
+
+ + + {#if searchQuery.length > 0} + + {/if} +
+ + {#if searchQuery || filterOption !== 'all' || sortOption !== 'name_asc'} + + {/if} +
+ + +
+
+ + {$t('adventures.sort')}: +
+
+ + + + + + +
+
+ + +
+ + {$t('adventures.show')}: + +
+ + + + + + +
+
+
+ + +{#if (filterOption === 'all' || filterOption === 'adventures') && filteredAdventures.length > 0} +
+
+

+ {$t('adventures.linked_adventures')} +

+
{filteredAdventures.length}
+
+
+ {#each filteredAdventures as adventure} + + {/each} +
+
+{/if} + + +{#if (filterOption === 'all' || filterOption === 'transportation') && filteredTransportations.length > 0} +
+
+

+ {$t('adventures.transportations')} +

+
{filteredTransportations.length}
+
+
+ {#each filteredTransportations as transportation} + + {/each} +
+
+{/if} + + +{#if (filterOption === 'all' || filterOption === 'lodging') && filteredLodging.length > 0} +
+
+

+ {$t('adventures.lodging')} +

+
{filteredLodging.length}
+
+
+ {#each filteredLodging as hotel} + + {/each} +
+
+{/if} + + +{#if (filterOption === 'all' || filterOption === 'notes') && filteredNotes.length > 0} +
+
+

+ {$t('adventures.notes')} +

+
{filteredNotes.length}
+
+
+ {#each filteredNotes as note} + + {/each} +
+
+{/if} + + +{#if (filterOption === 'all' || filterOption === 'checklists') && filteredChecklists.length > 0} +
+
+

+ {$t('adventures.checklists')} +

+
{filteredChecklists.length}
+
+
+ {#each filteredChecklists as checklist} + + {/each} +
+
+{/if} + + +{#if totalItems === 0} +
+
+
+
+ {#if searchQuery || filterOption !== 'all'} +
+ +
+ {:else} +
+ +
+ {/if} +
+ + {#if searchQuery || filterOption !== 'all'} +

+ {$t('immich.no_items_found')} +

+

+ {$t('collection.try_different_search')} +

+ + {:else} + + {/if} +
+
+
+{/if} diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 2261896..2194e1d 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -243,7 +243,8 @@ "delete_collection_warning": "Sind Sie sicher, dass Sie diese Sammlung löschen möchten? \nDiese Aktion kann nicht rückgängig gemacht werden.", "done": "Erledigt", "loading_adventures": "Ladeabenteuer ...", - "name_location": "Name, Ort" + "name_location": "Name, Ort", + "collection_contents": "Sammelinhalt" }, "home": { "desc_1": "Entdecken, planen und erkunden Sie mühelos", @@ -371,7 +372,12 @@ "show_map_labels": "Kartenbezeichnungen anzeigen", "total_cities": "Gesamtstädte", "total_countries": "Gesamtländer", - "total_regions": "Gesamtregionen" + "total_regions": "Gesamtregionen", + "newest_first": "Neuester zuerst", + "oldest_first": "Älteste zuerst", + "unvisited_first": "Zuerst nicht besucht", + "visited_first": "Zuerst besucht", + "total_items": "Gesamtartikel" }, "settings": { "account_settings": "Benutzerkonto", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 9114857..8f19349 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -220,6 +220,7 @@ "no_adventures_to_recommendations": "No adventures found. Add at least one adventure to get recommendations.", "display_name": "Display Name", "adventure_not_found": "There are no adventures to display. Add some using the plus button at the bottom right or try changing filters!", + "collection_contents": "Collection Contents", "no_adventures_found": "No adventures found", "no_adventures_message": "Start documenting your adventures and planning new ones. Every journey has a story worth telling.", "mark_visited": "Mark Visited", @@ -337,6 +338,7 @@ "filter_by_region": "Filter by Region", "all_regions": "All Regions", "clear_all_filters": "Clear All Filters", + "total_items": "Total Items", "filter_by": "Filter by", "interactive_map": "Interactive Map", "no_regions_found": "No regions found", @@ -346,7 +348,11 @@ "show_map_labels": "Show Map Labels", "hide_map_labels": "Hide Map Labels", "total_cities": "Total Cities", - "region_completed": "Region completed" + "region_completed": "Region completed", + "newest_first": "Newest First", + "oldest_first": "Oldest First", + "visited_first": "Visited First", + "unvisited_first": "Unvisited First" }, "auth": { "username": "Username", diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json index fbf87d0..4ab423f 100644 --- a/frontend/src/locales/es.json +++ b/frontend/src/locales/es.json @@ -295,7 +295,8 @@ "delete_collection_warning": "¿Estás seguro de que quieres eliminar esta colección? \nEsta acción no se puede deshacer.", "done": "Hecho", "loading_adventures": "Cargando aventuras ...", - "name_location": "Nombre, ubicación" + "name_location": "Nombre, ubicación", + "collection_contents": "Contenido de la colección" }, "worldtravel": { "all": "Todo", @@ -346,7 +347,12 @@ "show_map_labels": "Mostrar etiquetas de mapa", "total_regions": "Total de regiones", "region_completed": "Región completada", - "total_cities": "Ciudades totales" + "total_cities": "Ciudades totales", + "newest_first": "El primero primero", + "oldest_first": "El más antiguo primero", + "unvisited_first": "Primero no visitado", + "visited_first": "Visitado primero", + "total_items": "Total de artículos" }, "auth": { "forgot_password": "¿Has olvidado tu contraseña?", diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json index 7f66cdf..377f396 100644 --- a/frontend/src/locales/fr.json +++ b/frontend/src/locales/fr.json @@ -243,7 +243,8 @@ "delete_collection_warning": "Êtes-vous sûr de vouloir supprimer cette collection? \nCette action ne peut pas être annulée.", "done": "Fait", "loading_adventures": "Chargement des aventures ...", - "name_location": "nom, emplacement" + "name_location": "nom, emplacement", + "collection_contents": "Contenu de la collection" }, "home": { "desc_1": "Découvrez, planifiez et explorez en toute simplicité", @@ -371,7 +372,12 @@ "show_map_labels": "Afficher les étiquettes de carte", "total_cities": "Total des villes", "total_countries": "Total des pays", - "total_regions": "Régions totales" + "total_regions": "Régions totales", + "newest_first": "Le plus récent premier", + "oldest_first": "Le plus ancien premier", + "unvisited_first": "Sans visité d'abord", + "visited_first": "Visité en premier", + "total_items": "Total des articles" }, "settings": { "account_settings": "Paramètres du compte utilisateur", diff --git a/frontend/src/locales/it.json b/frontend/src/locales/it.json index d20257c..71ed2ee 100644 --- a/frontend/src/locales/it.json +++ b/frontend/src/locales/it.json @@ -243,7 +243,8 @@ "delete_collection_warning": "Sei sicuro di voler eliminare questa collezione? \nQuesta azione non può essere annullata.", "done": "Fatto", "loading_adventures": "Caricamento di avventure ...", - "name_location": "Nome, posizione" + "name_location": "Nome, posizione", + "collection_contents": "Contenuto di raccolta" }, "home": { "desc_1": "Scopri, pianifica ed esplora con facilità", @@ -371,7 +372,12 @@ "show_map_labels": "Mostra etichette mappe", "total_cities": "Città totali", "total_countries": "Paesi totali", - "total_regions": "Regioni totali" + "total_regions": "Regioni totali", + "newest_first": "Primo il più recente", + "oldest_first": "Prima più antico", + "unvisited_first": "Non visitato per primo", + "visited_first": "Visitato per primo", + "total_items": "Articoli totali" }, "settings": { "account_settings": "Impostazioni dell'account utente", diff --git a/frontend/src/locales/ko.json b/frontend/src/locales/ko.json index c40063d..85aad1c 100644 --- a/frontend/src/locales/ko.json +++ b/frontend/src/locales/ko.json @@ -243,7 +243,8 @@ "delete_collection_warning": "이 컬렉션을 삭제 하시겠습니까? \n이 조치는 취소 할 수 없습니다.", "done": "완료", "loading_adventures": "적재 모험 ...", - "name_location": "이름, 위치" + "name_location": "이름, 위치", + "collection_contents": "수집 내용" }, "auth": { "confirm_password": "비밀번호 확인", @@ -663,7 +664,12 @@ "show_map_labels": "지도 레이블 표시", "total_cities": "총 도시", "total_countries": "총 국가", - "total_regions": "총 지역" + "total_regions": "총 지역", + "newest_first": "최신 첫 번째", + "oldest_first": "가장 오래된 첫 번째", + "unvisited_first": "먼저 방문하지 않습니다", + "visited_first": "먼저 방문했습니다", + "total_items": "총 항목" }, "lodging": { "apartment": "아파트", diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json index bed5f2f..69eb2fe 100644 --- a/frontend/src/locales/nl.json +++ b/frontend/src/locales/nl.json @@ -243,7 +243,8 @@ "delete_collection_warning": "Weet u zeker dat u deze collectie wilt verwijderen? \nDeze actie kan niet ongedaan worden gemaakt.", "done": "Klaar", "loading_adventures": "Adventuren laden ...", - "name_location": "naam, locatie" + "name_location": "naam, locatie", + "collection_contents": "Verzamelingsinhoud" }, "home": { "desc_1": "Ontdek, plan en verken met gemak", @@ -371,7 +372,12 @@ "show_map_labels": "Toon kaartlabels", "total_cities": "Totale steden", "total_countries": "Totale landen", - "total_regions": "Totaal aantal regio's" + "total_regions": "Totaal aantal regio's", + "newest_first": "Nieuwste eerste", + "oldest_first": "Oudste eerste", + "unvisited_first": "Eerst niet bezocht", + "visited_first": "Eerst bezocht", + "total_items": "Totale items" }, "settings": { "account_settings": "Gebruikersaccount instellingen", diff --git a/frontend/src/locales/no.json b/frontend/src/locales/no.json index bc828b1..5e2583f 100644 --- a/frontend/src/locales/no.json +++ b/frontend/src/locales/no.json @@ -295,7 +295,8 @@ "delete_collection_warning": "Er du sikker på at du vil slette denne samlingen? \nDenne handlingen kan ikke angres.", "done": "Ferdig", "loading_adventures": "Laster opp eventyr ...", - "name_location": "Navn, plassering" + "name_location": "Navn, plassering", + "collection_contents": "Samlingsinnhold" }, "worldtravel": { "country_list": "Liste over land", @@ -346,7 +347,12 @@ "show_map_labels": "Vis kartetiketter", "total_cities": "Totalt byer", "total_countries": "Totalt land", - "total_regions": "Totale regioner" + "total_regions": "Totale regioner", + "newest_first": "Nyeste først", + "oldest_first": "Eldste først", + "unvisited_first": "Uvisitert først", + "visited_first": "Besøkte først", + "total_items": "Totalt gjenstander" }, "auth": { "username": "Brukernavn", diff --git a/frontend/src/locales/pl.json b/frontend/src/locales/pl.json index 39768d6..99c79cf 100644 --- a/frontend/src/locales/pl.json +++ b/frontend/src/locales/pl.json @@ -295,7 +295,8 @@ "done": "Zrobione", "loading_adventures": "Ładowanie przygód ...", "name_location": "Nazwa, lokalizacja", - "delete_collection_warning": "Czy na pewno chcesz usunąć tę kolekcję? \nTego działania nie można cofnąć." + "delete_collection_warning": "Czy na pewno chcesz usunąć tę kolekcję? \nTego działania nie można cofnąć.", + "collection_contents": "Zawartość kolekcji" }, "worldtravel": { "country_list": "Lista krajów", @@ -346,7 +347,12 @@ "total_countries": "Kraje ogółem", "total_regions": "Regiony ogółem", "all_regions": "Wszystkie regiony", - "cities_in": "Miasta w" + "cities_in": "Miasta w", + "newest_first": "Najnowszy pierwszy", + "oldest_first": "Najstarszy pierwszy", + "unvisited_first": "Najpierw niewidziane", + "visited_first": "Odwiedziłem pierwszy", + "total_items": "Całkowite przedmioty" }, "auth": { "username": "Nazwa użytkownika", diff --git a/frontend/src/locales/ru.json b/frontend/src/locales/ru.json index 7314798..cb3ad40 100644 --- a/frontend/src/locales/ru.json +++ b/frontend/src/locales/ru.json @@ -295,7 +295,8 @@ "delete_collection_warning": "Вы уверены, что хотите удалить эту коллекцию? \nЭто действие не может быть отменено.", "done": "Сделанный", "loading_adventures": "Загрузка приключений ...", - "name_location": "имя, местоположение" + "name_location": "имя, местоположение", + "collection_contents": "Содержание коллекции" }, "worldtravel": { "country_list": "Список стран", @@ -346,7 +347,12 @@ "show_map_labels": "Показать этикетки карты", "total_cities": "Общие города", "total_countries": "Всего стран", - "total_regions": "Общие регионы" + "total_regions": "Общие регионы", + "newest_first": "Новейший первый", + "oldest_first": "Сначала старейший", + "unvisited_first": "Не заселяется первым", + "visited_first": "Посетил первым", + "total_items": "Общие предметы" }, "auth": { "username": "Имя пользователя", diff --git a/frontend/src/locales/sv.json b/frontend/src/locales/sv.json index 3e47582..249c2c3 100644 --- a/frontend/src/locales/sv.json +++ b/frontend/src/locales/sv.json @@ -243,7 +243,8 @@ "delete_collection_warning": "Är du säker på att du vill ta bort den här samlingen? \nDenna åtgärd kan inte ångras.", "done": "Gjort", "loading_adventures": "Laddar äventyr ...", - "name_location": "namn, plats" + "name_location": "namn, plats", + "collection_contents": "Insamlingsinnehåll" }, "home": { "desc_1": "Upptäck, planera och utforska med lätthet", @@ -346,7 +347,12 @@ "show_map_labels": "Visa kartetiketter", "total_cities": "Totala städer", "total_countries": "Totala länder", - "total_regions": "Totala regioner" + "total_regions": "Totala regioner", + "newest_first": "Nyaste första", + "oldest_first": "Äldsta först", + "unvisited_first": "Oöverträffad först", + "visited_first": "Besökt först", + "total_items": "Totala artiklar" }, "auth": { "confirm_password": "Bekräfta lösenord", diff --git a/frontend/src/locales/zh.json b/frontend/src/locales/zh.json index 30eb783..2233af4 100644 --- a/frontend/src/locales/zh.json +++ b/frontend/src/locales/zh.json @@ -295,7 +295,8 @@ "delete_collection_warning": "您确定要删除此系列吗?\n该动作不能撤消。", "done": "完毕", "loading_adventures": "加载冒险...", - "name_location": "名称,位置" + "name_location": "名称,位置", + "collection_contents": "收集内容" }, "auth": { "forgot_password": "忘记密码?", @@ -368,7 +369,12 @@ "show_map": "显示地图", "show_map_labels": "显示地图标签", "total_cities": "总城市", - "total_countries": "总国家" + "total_countries": "总国家", + "newest_first": "最新的第一", + "oldest_first": "最古老的第一", + "unvisited_first": "首先未访问", + "visited_first": "首先访问", + "total_items": "总项目" }, "users": { "no_users_found": "未找到已公开个人资料的用户。" diff --git a/frontend/src/routes/collections/[id]/+page.svelte b/frontend/src/routes/collections/[id]/+page.svelte index 32f94cb..5f64513 100644 --- a/frontend/src/routes/collections/[id]/+page.svelte +++ b/frontend/src/routes/collections/[id]/+page.svelte @@ -41,6 +41,7 @@ import { goto } from '$app/navigation'; import LodgingModal from '$lib/components/LodgingModal.svelte'; import LodgingCard from '$lib/components/LodgingCard.svelte'; + import CollectionAllView from '$lib/components/CollectionAllView.svelte'; export let data: PageData; console.log(data); @@ -651,7 +652,7 @@ {#if data.user && data.user.uuid && (data.user.uuid == collection.user_id || (collection.shared_with && collection.shared_with.includes(data.user.uuid))) && !collection.is_archived}
-