-
-
-
+
+
+
+ {#if checklist?.id}
+
+ {$t('checklist.checklist_editor')}
+
+ {:else}
+ {$t('checklist.new_checklist')}
+ {/if}
+
+
diff --git a/frontend/src/lib/components/CollectionModal.svelte b/frontend/src/lib/components/CollectionModal.svelte
index a6fb823..5c134e0 100644
--- a/frontend/src/lib/components/CollectionModal.svelte
+++ b/frontend/src/lib/components/CollectionModal.svelte
@@ -21,7 +21,7 @@
is_public: collectionToEdit?.is_public || false,
adventures: collectionToEdit?.adventures || [],
link: collectionToEdit?.link || '',
- shared_with: collectionToEdit?.shared_with || []
+ shared_with: undefined
};
console.log(collection);
@@ -47,6 +47,10 @@
event.preventDefault();
console.log(collection);
+ if (collection.start_date && !collection.end_date) {
+ collection.end_date = collection.start_date;
+ }
+
if (collection.id === '') {
let res = await fetch('/api/collections', {
method: 'POST',
diff --git a/frontend/src/lib/components/NoteCard.svelte b/frontend/src/lib/components/NoteCard.svelte
index 492e6cb..f513f78 100644
--- a/frontend/src/lib/components/NoteCard.svelte
+++ b/frontend/src/lib/components/NoteCard.svelte
@@ -15,6 +15,19 @@
export let collection: Collection | null = null;
let isWarningModalOpen: boolean = false;
+ let unlinked: boolean = false;
+
+ $: {
+ if (collection?.start_date && collection.end_date) {
+ const startOutsideRange =
+ note.date && collection.start_date < note.date && collection.end_date < note.date;
+
+ const endOutsideRange =
+ note.date && collection.start_date > note.date && collection.end_date > note.date;
+
+ unlinked = !!(startOutsideRange || endOutsideRange);
+ }
+ }
function editNote() {
dispatch('edit', note);
@@ -55,6 +68,9 @@
{$t('adventures.note')}
+ {#if unlinked}
+
{$t('adventures.out_of_range')}
+ {/if}
{#if note.links && note.links.length > 0}
{note.links.length}
@@ -74,7 +90,7 @@
- {#if note.user_id == user?.uuid || (collection && user && collection.shared_with.includes(user.uuid))}
+ {#if note.user_id == user?.uuid || (collection && user && collection.shared_with && collection.shared_with.includes(user.uuid))}