1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-24 07:19:36 +02:00

Fix date handling in CollectionModal to set null values for missing start and end dates; update localization files to add new confirmation messages and labels.

This commit is contained in:
Sean Morley 2024-12-28 14:48:30 -05:00
parent 697c40fca0
commit 7cf634def8
10 changed files with 301 additions and 113 deletions

View file

@ -64,6 +64,11 @@
collection.start_date = collection.end_date; collection.start_date = collection.end_date;
} }
if (!collection.start_date && !collection.end_date) {
collection.start_date = null;
collection.end_date = null;
}
if (collection.id === '') { if (collection.id === '') {
let res = await fetch('/api/collections', { let res = await fetch('/api/collections', {
method: 'POST', method: 'POST',

View file

@ -197,7 +197,25 @@
"show": "Zeigen", "show": "Zeigen",
"download_calendar": "Kalender herunterladen", "download_calendar": "Kalender herunterladen",
"md_instructions": "Schreiben Sie hier Ihren Abschlag...", "md_instructions": "Schreiben Sie hier Ihren Abschlag...",
"preview": "Vorschau" "preview": "Vorschau",
"checklist_delete_confirm": "Sind Sie sicher, dass Sie diese Checkliste löschen möchten? \nDiese Aktion kann nicht rückgängig gemacht werden.",
"clear_location": "Standort löschen",
"date_information": "Datumsinformationen",
"delete_checklist": "Checkliste löschen",
"delete_note": "Notiz löschen",
"delete_transportation": "Transport löschen",
"end": "Ende",
"ending_airport": "Endflughafen",
"flight_information": "Fluginformationen",
"from": "Aus",
"no_location_found": "Kein Standort gefunden",
"note_delete_confirm": "Sind Sie sicher, dass Sie diese Notiz löschen möchten? \nDiese Aktion kann nicht rückgängig gemacht werden.",
"out_of_range": "Nicht im Datumsbereich der Reiseroute",
"show_region_labels": "Regionsbeschriftungen anzeigen",
"start": "Start",
"starting_airport": "Startflughafen",
"to": "Zu",
"transportation_delete_confirm": "Sind Sie sicher, dass Sie diesen Transport löschen möchten? \nDiese Aktion kann nicht rückgängig gemacht werden."
}, },
"home": { "home": {
"desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit", "desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit",
@ -364,7 +382,9 @@
"item_cannot_be_empty": "Das Element darf nicht leer sein", "item_cannot_be_empty": "Das Element darf nicht leer sein",
"items": "Artikel", "items": "Artikel",
"new_item": "Neuer Artikel", "new_item": "Neuer Artikel",
"save": "Speichern" "save": "Speichern",
"checklist_viewer": "Checklisten-Viewer",
"new_checklist": "Neue Checkliste"
}, },
"collection": { "collection": {
"collection_created": "Sammlung erfolgreich erstellt!", "collection_created": "Sammlung erfolgreich erstellt!",
@ -373,7 +393,8 @@
"edit_collection": "Sammlung bearbeiten", "edit_collection": "Sammlung bearbeiten",
"error_creating_collection": "Fehler beim Erstellen der Sammlung", "error_creating_collection": "Fehler beim Erstellen der Sammlung",
"error_editing_collection": "Fehler beim Bearbeiten der Sammlung", "error_editing_collection": "Fehler beim Bearbeiten der Sammlung",
"new_collection": "Neue Kollektion" "new_collection": "Neue Kollektion",
"public_collection": "Öffentliche Sammlung"
}, },
"notes": { "notes": {
"add_a_link": "Fügen Sie einen Link hinzu", "add_a_link": "Fügen Sie einen Link hinzu",
@ -386,7 +407,8 @@
"note_public": "Diese Notiz ist öffentlich, da sie sich in einer öffentlichen Sammlung befindet.", "note_public": "Diese Notiz ist öffentlich, da sie sich in einer öffentlichen Sammlung befindet.",
"open": "Offen", "open": "Offen",
"save": "Speichern", "save": "Speichern",
"invalid_url": "Ungültige URL" "invalid_url": "Ungültige URL",
"note_viewer": "Notizenbetrachter"
}, },
"transportation": { "transportation": {
"date_and_time": "Datum", "date_and_time": "Datum",

View file

@ -244,7 +244,25 @@
"show": "Espectáculo", "show": "Espectáculo",
"download_calendar": "Descargar Calendario", "download_calendar": "Descargar Calendario",
"md_instructions": "Escriba su descuento aquí...", "md_instructions": "Escriba su descuento aquí...",
"preview": "Avance" "preview": "Avance",
"checklist_delete_confirm": "¿Está seguro de que desea eliminar esta lista de verificación? \nEsta acción no se puede deshacer.",
"clear_location": "Borrar ubicación",
"date_information": "Información de fecha",
"delete_checklist": "Eliminar lista de verificación",
"delete_note": "Eliminar nota",
"delete_transportation": "Eliminar transporte",
"end": "Fin",
"ending_airport": "Aeropuerto final",
"flight_information": "Información de vuelo",
"from": "De",
"no_location_found": "No se encontró ninguna ubicación",
"note_delete_confirm": "¿Estás seguro de que deseas eliminar esta nota? \nEsta acción no se puede deshacer.",
"out_of_range": "No en el rango de fechas del itinerario",
"show_region_labels": "Mostrar etiquetas de región",
"start": "Comenzar",
"starting_airport": "Aeropuerto de inicio",
"to": "A",
"transportation_delete_confirm": "¿Está seguro de que desea eliminar este transporte? \nEsta acción no se puede deshacer."
}, },
"worldtravel": { "worldtravel": {
"all": "Todo", "all": "Todo",
@ -364,7 +382,9 @@
"item_cannot_be_empty": "El artículo no puede estar vacío", "item_cannot_be_empty": "El artículo no puede estar vacío",
"items": "Elementos", "items": "Elementos",
"new_item": "Nuevo artículo", "new_item": "Nuevo artículo",
"save": "Ahorrar" "save": "Ahorrar",
"checklist_viewer": "Visor de lista de verificación",
"new_checklist": "Nueva lista de verificación"
}, },
"collection": { "collection": {
"collection_created": "¡Colección creada con éxito!", "collection_created": "¡Colección creada con éxito!",
@ -373,7 +393,8 @@
"edit_collection": "Editar colección", "edit_collection": "Editar colección",
"error_creating_collection": "Error al crear la colección", "error_creating_collection": "Error al crear la colección",
"error_editing_collection": "Error al editar la colección", "error_editing_collection": "Error al editar la colección",
"new_collection": "Nueva colección" "new_collection": "Nueva colección",
"public_collection": "Colección pública"
}, },
"notes": { "notes": {
"add_a_link": "Agregar un enlace", "add_a_link": "Agregar un enlace",
@ -386,7 +407,8 @@
"note_public": "Esta nota es pública porque está en una colección pública.", "note_public": "Esta nota es pública porque está en una colección pública.",
"open": "Abierto", "open": "Abierto",
"save": "Ahorrar", "save": "Ahorrar",
"invalid_url": "URL no válida" "invalid_url": "URL no válida",
"note_viewer": "Visor de notas"
}, },
"transportation": { "transportation": {
"date_and_time": "Fecha", "date_and_time": "Fecha",

View file

@ -197,7 +197,25 @@
"show": "Montrer", "show": "Montrer",
"download_calendar": "Télécharger le calendrier", "download_calendar": "Télécharger le calendrier",
"md_instructions": "Écrivez votre démarque ici...", "md_instructions": "Écrivez votre démarque ici...",
"preview": "Aperçu" "preview": "Aperçu",
"checklist_delete_confirm": "Êtes-vous sûr de vouloir supprimer cette liste de contrôle ? \nCette action ne peut pas être annulée.",
"clear_location": "Effacer l'emplacement",
"date_information": "Informations sur les dates",
"delete_checklist": "Supprimer la liste de contrôle",
"delete_note": "Supprimer la note",
"delete_transportation": "Supprimer le transport",
"end": "Fin",
"ending_airport": "Aéroport de fin",
"flight_information": "Informations sur le vol",
"from": "Depuis",
"no_location_found": "Aucun emplacement trouvé",
"note_delete_confirm": "Êtes-vous sûr de vouloir supprimer cette note ? \nCette action ne peut pas être annulée.",
"out_of_range": "Pas dans la plage de dates de l'itinéraire",
"show_region_labels": "Afficher les étiquettes de région",
"start": "Commencer",
"starting_airport": "Aéroport de départ",
"to": "À",
"transportation_delete_confirm": "Etes-vous sûr de vouloir supprimer ce transport ? \nCette action ne peut pas être annulée."
}, },
"home": { "home": {
"desc_1": "Découvrez, planifiez et explorez en toute simplicité", "desc_1": "Découvrez, planifiez et explorez en toute simplicité",
@ -364,7 +382,9 @@
"item_cannot_be_empty": "L'élément ne peut pas être vide", "item_cannot_be_empty": "L'élément ne peut pas être vide",
"items": "Articles", "items": "Articles",
"new_item": "Nouvel article", "new_item": "Nouvel article",
"save": "Sauvegarder" "save": "Sauvegarder",
"checklist_viewer": "Visionneuse de liste de contrôle",
"new_checklist": "Nouvelle liste de contrôle"
}, },
"collection": { "collection": {
"collection_created": "Collection créée avec succès !", "collection_created": "Collection créée avec succès !",
@ -373,7 +393,8 @@
"edit_collection": "Modifier la collection", "edit_collection": "Modifier la collection",
"error_creating_collection": "Erreur lors de la création de la collection", "error_creating_collection": "Erreur lors de la création de la collection",
"error_editing_collection": "Erreur lors de la modification de la collection", "error_editing_collection": "Erreur lors de la modification de la collection",
"new_collection": "Nouvelle collection" "new_collection": "Nouvelle collection",
"public_collection": "Collection publique"
}, },
"notes": { "notes": {
"add_a_link": "Ajouter un lien", "add_a_link": "Ajouter un lien",
@ -386,7 +407,8 @@
"note_public": "Cette note est publique car elle fait partie d'une collection publique.", "note_public": "Cette note est publique car elle fait partie d'une collection publique.",
"open": "Ouvrir", "open": "Ouvrir",
"save": "Sauvegarder", "save": "Sauvegarder",
"invalid_url": "URL invalide" "invalid_url": "URL invalide",
"note_viewer": "Visionneuse de notes"
}, },
"transportation": { "transportation": {
"date_time": "Date de début", "date_time": "Date de début",

View file

@ -197,7 +197,25 @@
"show": "Spettacolo", "show": "Spettacolo",
"download_calendar": "Scarica Calendario", "download_calendar": "Scarica Calendario",
"md_instructions": "Scrivi qui il tuo ribasso...", "md_instructions": "Scrivi qui il tuo ribasso...",
"preview": "Anteprima" "preview": "Anteprima",
"checklist_delete_confirm": "Sei sicuro di voler eliminare questa lista di controllo? \nQuesta azione non può essere annullata.",
"clear_location": "Cancella posizione",
"date_information": "Informazioni sulla data",
"delete_checklist": "Elimina lista di controllo",
"delete_note": "Elimina nota",
"delete_transportation": "Elimina trasporto",
"end": "FINE",
"ending_airport": "Fine dell'aeroporto",
"flight_information": "Informazioni sul volo",
"from": "Da",
"no_location_found": "Nessuna posizione trovata",
"note_delete_confirm": "Sei sicuro di voler eliminare questa nota? \nQuesta azione non può essere annullata.",
"out_of_range": "Non nell'intervallo di date dell'itinerario",
"show_region_labels": "Mostra etichette regione",
"start": "Inizio",
"starting_airport": "Inizio aeroporto",
"to": "A",
"transportation_delete_confirm": "Sei sicuro di voler eliminare questo trasporto? \nQuesta azione non può essere annullata."
}, },
"home": { "home": {
"desc_1": "Scopri, pianifica ed esplora con facilità", "desc_1": "Scopri, pianifica ed esplora con facilità",
@ -364,7 +382,9 @@
"item_cannot_be_empty": "L'articolo non può essere vuoto", "item_cannot_be_empty": "L'articolo non può essere vuoto",
"items": "Elementi", "items": "Elementi",
"save": "Salva", "save": "Salva",
"new_item": "Nuovo articolo" "new_item": "Nuovo articolo",
"checklist_viewer": "Visualizzatore della lista di controllo",
"new_checklist": "Nuova lista di controllo"
}, },
"collection": { "collection": {
"edit_collection": "Modifica raccolta", "edit_collection": "Modifica raccolta",
@ -373,7 +393,8 @@
"new_collection": "Nuova collezione", "new_collection": "Nuova collezione",
"collection_created": "Collezione creata con successo!", "collection_created": "Collezione creata con successo!",
"collection_edit_success": "Raccolta modificata con successo!", "collection_edit_success": "Raccolta modificata con successo!",
"create": "Creare" "create": "Creare",
"public_collection": "Collezione pubblica"
}, },
"notes": { "notes": {
"add_a_link": "Aggiungi un collegamento", "add_a_link": "Aggiungi un collegamento",
@ -386,7 +407,8 @@
"note_public": "Questa nota è pubblica perché è in una collezione pubblica.", "note_public": "Questa nota è pubblica perché è in una collezione pubblica.",
"open": "Aprire", "open": "Aprire",
"save": "Salva", "save": "Salva",
"invalid_url": "URL non valido" "invalid_url": "URL non valido",
"note_viewer": "Visualizzatore di note"
}, },
"transportation": { "transportation": {
"date_and_time": "Data", "date_and_time": "Data",

View file

@ -197,7 +197,25 @@
"show": "Show", "show": "Show",
"download_calendar": "Agenda downloaden", "download_calendar": "Agenda downloaden",
"md_instructions": "Schrijf hier uw korting...", "md_instructions": "Schrijf hier uw korting...",
"preview": "Voorbeeld" "preview": "Voorbeeld",
"checklist_delete_confirm": "Weet u zeker dat u deze checklist wilt verwijderen? \nDeze actie kan niet ongedaan worden gemaakt.",
"clear_location": "Locatie wissen",
"date_information": "Datuminformatie",
"delete_checklist": "Controlelijst verwijderen",
"delete_note": "Notitie verwijderen",
"delete_transportation": "Transport verwijderen",
"end": "Einde",
"flight_information": "Vluchtinformatie",
"from": "Van",
"no_location_found": "Geen locatie gevonden",
"note_delete_confirm": "Weet u zeker dat u deze notitie wilt verwijderen? \nDeze actie kan niet ongedaan worden gemaakt.",
"out_of_range": "Niet binnen het datumbereik van het reisplan",
"show_region_labels": "Toon regiolabels",
"start": "Begin",
"starting_airport": "Startende luchthaven",
"to": "Naar",
"transportation_delete_confirm": "Weet u zeker dat u dit transport wilt verwijderen? \nDeze actie kan niet ongedaan worden gemaakt.",
"ending_airport": "Einde luchthaven"
}, },
"home": { "home": {
"desc_1": "Ontdek, plan en verken met gemak", "desc_1": "Ontdek, plan en verken met gemak",
@ -364,7 +382,9 @@
"item_cannot_be_empty": "Artikel mag niet leeg zijn", "item_cannot_be_empty": "Artikel mag niet leeg zijn",
"items": "Artikelen", "items": "Artikelen",
"new_item": "Nieuw artikel", "new_item": "Nieuw artikel",
"save": "Opslaan" "save": "Opslaan",
"checklist_viewer": "Controlelijstviewer",
"new_checklist": "Nieuwe checklist"
}, },
"collection": { "collection": {
"collection_created": "Collectie succesvol aangemaakt!", "collection_created": "Collectie succesvol aangemaakt!",
@ -373,7 +393,8 @@
"edit_collection": "Collectie bewerken", "edit_collection": "Collectie bewerken",
"error_creating_collection": "Fout bij aanmaken collectie", "error_creating_collection": "Fout bij aanmaken collectie",
"error_editing_collection": "Fout bij bewerken collectie", "error_editing_collection": "Fout bij bewerken collectie",
"new_collection": "Nieuwe collectie" "new_collection": "Nieuwe collectie",
"public_collection": "Openbare collectie"
}, },
"notes": { "notes": {
"add_a_link": "Voeg een link toe", "add_a_link": "Voeg een link toe",
@ -386,7 +407,8 @@
"note_public": "Deze opmerking is openbaar omdat deze zich in een openbare collectie bevindt.", "note_public": "Deze opmerking is openbaar omdat deze zich in een openbare collectie bevindt.",
"open": "Open", "open": "Open",
"save": "Opslaan", "save": "Opslaan",
"invalid_url": "Ongeldige URL" "invalid_url": "Ongeldige URL",
"note_viewer": "Notitieviewer"
}, },
"transportation": { "transportation": {
"date_and_time": "Datum", "date_and_time": "Datum",

View file

@ -244,7 +244,25 @@
"show": "Pokazywać", "show": "Pokazywać",
"download_calendar": "Pobierz Kalendarz", "download_calendar": "Pobierz Kalendarz",
"md_instructions": "Napisz tutaj swoją przecenę...", "md_instructions": "Napisz tutaj swoją przecenę...",
"preview": "Zapowiedź" "preview": "Zapowiedź",
"checklist_delete_confirm": "Czy na pewno chcesz usunąć tę listę kontrolną? \nTej akcji nie można cofnąć.",
"clear_location": "Wyczyść lokalizację",
"date_information": "Informacje o dacie",
"delete_checklist": "Usuń listę kontrolną",
"delete_note": "Usuń notatkę",
"delete_transportation": "Usuń transport",
"end": "Koniec",
"ending_airport": "Kończy się lotnisko",
"flight_information": "Informacje o locie",
"from": "Z",
"no_location_found": "Nie znaleziono lokalizacji",
"note_delete_confirm": "Czy na pewno chcesz usunąć tę notatkę? \nTej akcji nie można cofnąć.",
"out_of_range": "Nie mieści się w zakresie dat planu podróży",
"show_region_labels": "Pokaż etykiety regionów",
"start": "Start",
"starting_airport": "Początkowe lotnisko",
"to": "Do",
"transportation_delete_confirm": "Czy na pewno chcesz usunąć ten transport? \nTej akcji nie można cofnąć."
}, },
"worldtravel": { "worldtravel": {
"country_list": "Lista krajów", "country_list": "Lista krajów",
@ -358,7 +376,8 @@
"create": "Utwórz", "create": "Utwórz",
"collection_edit_success": "Kolekcja została pomyślnie edytowana!", "collection_edit_success": "Kolekcja została pomyślnie edytowana!",
"error_editing_collection": "Błąd podczas edytowania kolekcji", "error_editing_collection": "Błąd podczas edytowania kolekcji",
"edit_collection": "Edytuj kolekcję" "edit_collection": "Edytuj kolekcję",
"public_collection": "Kolekcja publiczna"
}, },
"notes": { "notes": {
"note_deleted": "Notatka została pomyślnie usunięta!", "note_deleted": "Notatka została pomyślnie usunięta!",
@ -371,7 +390,8 @@
"save": "Zapisz", "save": "Zapisz",
"note_public": "Ta notatka jest publiczna, ponieważ znajduje się w publicznej kolekcji.", "note_public": "Ta notatka jest publiczna, ponieważ znajduje się w publicznej kolekcji.",
"add_a_link": "Dodaj link", "add_a_link": "Dodaj link",
"invalid_url": "Nieprawidłowy URL" "invalid_url": "Nieprawidłowy URL",
"note_viewer": "Przeglądarka notatek"
}, },
"checklist": { "checklist": {
"checklist_deleted": "Lista kontrolna została pomyślnie usunięta!", "checklist_deleted": "Lista kontrolna została pomyślnie usunięta!",
@ -386,7 +406,9 @@
"save": "Zapisz", "save": "Zapisz",
"checklist_public": "Ta lista kontrolna jest publiczna, ponieważ znajduje się w publicznej kolekcji.", "checklist_public": "Ta lista kontrolna jest publiczna, ponieważ znajduje się w publicznej kolekcji.",
"item_cannot_be_empty": "Element nie może być pusty", "item_cannot_be_empty": "Element nie może być pusty",
"item_already_exists": "Element już istnieje" "item_already_exists": "Element już istnieje",
"checklist_viewer": "Przeglądarka listy kontrolnej",
"new_checklist": "Nowa lista kontrolna"
}, },
"transportation": { "transportation": {
"transportation_deleted": "Transport został pomyślnie usunięty!", "transportation_deleted": "Transport został pomyślnie usunięty!",

View file

@ -197,7 +197,25 @@
"show": "Visa", "show": "Visa",
"download_calendar": "Ladda ner kalender", "download_calendar": "Ladda ner kalender",
"md_instructions": "Skriv din avskrivning här...", "md_instructions": "Skriv din avskrivning här...",
"preview": "Förhandsvisning" "preview": "Förhandsvisning",
"checklist_delete_confirm": "Är du säker på att du vill ta bort den här checklistan? \nDenna åtgärd kan inte ångras.",
"clear_location": "Rensa plats",
"date_information": "Datuminformation",
"delete_checklist": "Ta bort checklista",
"delete_note": "Ta bort anteckning",
"delete_transportation": "Ta bort Transport",
"end": "Avsluta",
"ending_airport": "Slutar flygplats",
"flight_information": "Flyginformation",
"from": "Från",
"no_location_found": "Ingen plats hittades",
"note_delete_confirm": "Är du säker på att du vill ta bort den här anteckningen? \nDenna åtgärd kan inte ångras.",
"out_of_range": "Inte inom resplanens datumintervall",
"show_region_labels": "Visa regionetiketter",
"start": "Start",
"starting_airport": "Startar flygplats",
"to": "Till",
"transportation_delete_confirm": "Är du säker på att du vill ta bort denna transport? \nDenna åtgärd kan inte ångras."
}, },
"home": { "home": {
"desc_1": "Upptäck, planera och utforska med lätthet", "desc_1": "Upptäck, planera och utforska med lätthet",
@ -364,7 +382,9 @@
"item_cannot_be_empty": "Objektet får inte vara tomt", "item_cannot_be_empty": "Objektet får inte vara tomt",
"items": "Föremål", "items": "Föremål",
"new_item": "Nytt föremål", "new_item": "Nytt föremål",
"save": "Spara" "save": "Spara",
"checklist_viewer": "Checklista Viewer",
"new_checklist": "Ny checklista"
}, },
"collection": { "collection": {
"collection_created": "Samlingen har skapats!", "collection_created": "Samlingen har skapats!",
@ -373,7 +393,8 @@
"edit_collection": "Redigera samling", "edit_collection": "Redigera samling",
"error_creating_collection": "Det gick inte att skapa samlingen", "error_creating_collection": "Det gick inte att skapa samlingen",
"error_editing_collection": "Fel vid redigering av samling", "error_editing_collection": "Fel vid redigering av samling",
"new_collection": "Ny samling" "new_collection": "Ny samling",
"public_collection": "Offentlig samling"
}, },
"notes": { "notes": {
"add_a_link": "Lägg till en länk", "add_a_link": "Lägg till en länk",
@ -386,7 +407,8 @@
"note_public": "Den här anteckningen är offentlig eftersom den finns i en offentlig samling.", "note_public": "Den här anteckningen är offentlig eftersom den finns i en offentlig samling.",
"open": "Öppna", "open": "Öppna",
"save": "Spara", "save": "Spara",
"invalid_url": "Ogiltig URL" "invalid_url": "Ogiltig URL",
"note_viewer": "Note Viewer"
}, },
"transportation": { "transportation": {
"date_and_time": "Datum", "date_and_time": "Datum",

View file

@ -197,7 +197,25 @@
"show": "展示", "show": "展示",
"download_calendar": "下载日历", "download_calendar": "下载日历",
"md_instructions": "在这里写下你的标记...", "md_instructions": "在这里写下你的标记...",
"preview": "预览" "preview": "预览",
"checklist_delete_confirm": "您确定要删除此清单吗?\n此操作无法撤消。",
"clear_location": "明确的位置",
"date_information": "日期信息",
"delete_checklist": "删除清单",
"delete_note": "删除注释",
"delete_transportation": "删除交通",
"end": "结尾",
"ending_airport": "结束机场",
"flight_information": "航班信息",
"from": "从",
"no_location_found": "没有找到位置",
"note_delete_confirm": "您确定要删除此注释吗?\n此操作无法撤消。",
"out_of_range": "不在行程日期范围内",
"show_region_labels": "显示区域标签",
"start": "开始",
"starting_airport": "出发机场",
"to": "到",
"transportation_delete_confirm": "您确定要删除此交通工具吗?\n此操作无法撤消。"
}, },
"home": { "home": {
"desc_1": "轻松发现、规划和探索", "desc_1": "轻松发现、规划和探索",
@ -364,7 +382,9 @@
"item_cannot_be_empty": "项目不能为空", "item_cannot_be_empty": "项目不能为空",
"items": "项目", "items": "项目",
"new_item": "新商品", "new_item": "新商品",
"save": "节省" "save": "节省",
"checklist_viewer": "清单查看器",
"new_checklist": "新清单"
}, },
"collection": { "collection": {
"collection_created": "收藏创建成功!", "collection_created": "收藏创建成功!",
@ -373,7 +393,8 @@
"edit_collection": "编辑收藏", "edit_collection": "编辑收藏",
"error_creating_collection": "创建集合时出错", "error_creating_collection": "创建集合时出错",
"error_editing_collection": "编辑集合时出错", "error_editing_collection": "编辑集合时出错",
"new_collection": "新系列" "new_collection": "新系列",
"public_collection": "公共收藏"
}, },
"notes": { "notes": {
"add_a_link": "添加链接", "add_a_link": "添加链接",
@ -386,7 +407,8 @@
"note_public": "该笔记是公开的,因为它属于公共收藏。", "note_public": "该笔记是公开的,因为它属于公共收藏。",
"open": "打开", "open": "打开",
"save": "节省", "save": "节省",
"invalid_url": "无效网址" "invalid_url": "无效网址",
"note_viewer": "笔记查看器"
}, },
"transportation": { "transportation": {
"date_and_time": "日期", "date_and_time": "日期",

View file

@ -171,6 +171,11 @@
if (collection.checklists) { if (collection.checklists) {
checklists = collection.checklists; checklists = collection.checklists;
} }
if (!collection.start_date) {
currentView = 'all';
} else {
currentView = 'itinerary';
}
}); });
function deleteAdventure(event: CustomEvent<string>) { function deleteAdventure(event: CustomEvent<string>) {
@ -468,18 +473,20 @@
</div> </div>
{/if} {/if}
{#if collection.start_date} {#if collection.id}
<div class="flex justify-center mx-auto"> <div class="flex justify-center mx-auto">
<!-- svelte-ignore a11y-missing-attribute --> <!-- svelte-ignore a11y-missing-attribute -->
<div role="tablist" class="tabs tabs-boxed tabs-lg max-w-xl"> <div role="tablist" class="tabs tabs-boxed tabs-lg max-w-xl">
<!-- svelte-ignore a11y-missing-attribute --> <!-- svelte-ignore a11y-missing-attribute -->
<a {#if collection.start_date}
role="tab" <a
class="tab {currentView === 'itinerary' ? 'tab-active' : ''}" role="tab"
tabindex="0" class="tab {currentView === 'itinerary' ? 'tab-active' : ''}"
on:click={() => (currentView = 'itinerary')} tabindex="0"
on:keydown={(e) => e.key === 'Enter' && (currentView = 'itinerary')}>Itinerary</a on:click={() => (currentView = 'itinerary')}
> on:keydown={(e) => e.key === 'Enter' && (currentView = 'itinerary')}>Itinerary</a
>
{/if}
<a <a
role="tab" role="tab"
class="tab {currentView === 'all' ? 'tab-active' : ''}" class="tab {currentView === 'all' ? 'tab-active' : ''}"
@ -714,84 +721,84 @@
{/each} {/each}
</div> </div>
{/if} {/if}
{/if}
{#if currentView == 'map'} {#if currentView == 'map'}
<div class="card bg-base-200 shadow-xl my-8 mx-auto w-10/12"> <div class="card bg-base-200 shadow-xl my-8 mx-auto w-10/12">
<div class="card-body"> <div class="card-body">
<h2 class="card-title text-3xl justify-center mb-4">Trip Map</h2> <h2 class="card-title text-3xl justify-center mb-4">Trip Map</h2>
<MapLibre <MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json" style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
class="aspect-[9/16] max-h-[70vh] sm:aspect-video sm:max-h-full w-full rounded-lg" class="aspect-[9/16] max-h-[70vh] sm:aspect-video sm:max-h-full w-full rounded-lg"
standardControls standardControls
> >
{#each adventures as adventure} {#each adventures as adventure}
{#if adventure.longitude && adventure.latitude} {#if adventure.longitude && adventure.latitude}
<DefaultMarker lngLat={{ lng: adventure.longitude, lat: adventure.latitude }}> <DefaultMarker lngLat={{ lng: adventure.longitude, lat: adventure.latitude }}>
<Popup openOn="click" offset={[0, -10]}> <Popup openOn="click" offset={[0, -10]}>
<div class="text-lg text-black font-bold">{adventure.name}</div> <div class="text-lg text-black font-bold">{adventure.name}</div>
<p class="font-semibold text-black text-md"> <p class="font-semibold text-black text-md">
{adventure.category?.display_name + ' ' + adventure.category?.icon} {adventure.category?.display_name + ' ' + adventure.category?.icon}
</p> </p>
</Popup> </Popup>
</DefaultMarker> </DefaultMarker>
{/if} {/if}
{/each} {/each}
{#each transportations as transportation} {#each transportations as transportation}
{#if transportation.destination_latitude && transportation.destination_longitude} {#if transportation.destination_latitude && transportation.destination_longitude}
<Marker <Marker
lngLat={{ lngLat={{
lng: transportation.destination_longitude, lng: transportation.destination_longitude,
lat: transportation.destination_latitude lat: transportation.destination_latitude
}} }}
class="grid h-8 w-8 place-items-center rounded-full border border-gray-200 class="grid h-8 w-8 place-items-center rounded-full border border-gray-200
bg-red-300 text-black focus:outline-6 focus:outline-black" bg-red-300 text-black focus:outline-6 focus:outline-black"
> >
<span class="text-xl"> <span class="text-xl">
{getTransportationEmoji(transportation.type)} {getTransportationEmoji(transportation.type)}
</span> </span>
<Popup openOn="click" offset={[0, -10]}> <Popup openOn="click" offset={[0, -10]}>
<div class="text-lg text-black font-bold">{transportation.name}</div> <div class="text-lg text-black font-bold">{transportation.name}</div>
<p class="font-semibold text-black text-md"> <p class="font-semibold text-black text-md">
{transportation.type} {transportation.type}
</p> </p>
</Popup> </Popup>
</Marker> </Marker>
{/if} {/if}
{#if transportation.origin_latitude && transportation.origin_longitude} {#if transportation.origin_latitude && transportation.origin_longitude}
<Marker <Marker
lngLat={{ lngLat={{
lng: transportation.origin_longitude, lng: transportation.origin_longitude,
lat: transportation.origin_latitude lat: transportation.origin_latitude
}} }}
class="grid h-8 w-8 place-items-center rounded-full border border-gray-200 class="grid h-8 w-8 place-items-center rounded-full border border-gray-200
bg-green-300 text-black focus:outline-6 focus:outline-black" bg-green-300 text-black focus:outline-6 focus:outline-black"
> >
<span class="text-xl"> <span class="text-xl">
{getTransportationEmoji(transportation.type)} {getTransportationEmoji(transportation.type)}
</span> </span>
<Popup openOn="click" offset={[0, -10]}> <Popup openOn="click" offset={[0, -10]}>
<div class="text-lg text-black font-bold">{transportation.name}</div> <div class="text-lg text-black font-bold">{transportation.name}</div>
<p class="font-semibold text-black text-md"> <p class="font-semibold text-black text-md">
{transportation.type} {transportation.type}
</p> </p>
</Popup> </Popup>
</Marker> </Marker>
{/if} {/if}
{/each} {/each}
</MapLibre> </MapLibre>
</div>
</div> </div>
{/if} </div>
{#if currentView == 'calendar'} {/if}
<div class="card bg-base-200 shadow-xl my-8 mx-auto w-10/12"> {#if currentView == 'calendar'}
<div class="card-body"> <div class="card bg-base-200 shadow-xl my-8 mx-auto w-10/12">
<h2 class="card-title text-3xl justify-center mb-4"> <div class="card-body">
{$t('adventures.adventure_calendar')} <h2 class="card-title text-3xl justify-center mb-4">
</h2> {$t('adventures.adventure_calendar')}
<Calendar {plugins} {options} /> </h2>
</div> <Calendar {plugins} {options} />
</div> </div>
{/if} </div>
{/if} {/if}
{/if} {/if}