diff --git a/backend/server/adventures/models.py b/backend/server/adventures/models.py index 82063f8..a872abd 100644 --- a/backend/server/adventures/models.py +++ b/backend/server/adventures/models.py @@ -9,6 +9,7 @@ ADVENTURE_TYPES = [ ('visited', 'Visited'), ('planned', 'Planned'), ('lodging', 'Lodging'), + ('dining', 'Dining') ] diff --git a/frontend/src/lib/components/AdventureCard.svelte b/frontend/src/lib/components/AdventureCard.svelte index b9fac8a..8afa422 100644 --- a/frontend/src/lib/components/AdventureCard.svelte +++ b/frontend/src/lib/components/AdventureCard.svelte @@ -24,8 +24,20 @@ let isCollectionModalOpen: boolean = false; + let keyword: string = ''; + export let adventure: Adventure; + if (adventure.type == 'visited') { + keyword = 'Adventure'; + } else if (adventure.type == 'planned') { + keyword = 'Adventure'; + } else if (adventure.type == 'lodging') { + keyword = 'Lodging'; + } else if (adventure.type == 'dining') { + keyword = 'Dining'; + } + let activityTypes: string[] = []; // makes it reactivty to changes so it updates automatically $: { @@ -153,6 +165,8 @@
Planned
{:else if user?.pk == adventure.user_id && adventure.type == 'lodging'}
Lodging
+ {:else if user?.pk == adventure.user_id && adventure.type == 'dining'} +
Dining
{/if}
{adventure.is_public ? 'Public' : 'Private'}
@@ -197,7 +211,7 @@ >Open Details {#if adventure.type == 'visited'} diff --git a/frontend/src/lib/components/EditAdventure.svelte b/frontend/src/lib/components/EditAdventure.svelte index 7d26bd5..b663bf4 100644 --- a/frontend/src/lib/components/EditAdventure.svelte +++ b/frontend/src/lib/components/EditAdventure.svelte @@ -222,20 +222,22 @@ > -
-
- - -
+ {#if adventureToEdit.type == 'visited' || adventureToEdit.type == 'planned'} +
+
+ + +
+ {/if}

diff --git a/frontend/src/lib/components/NewAdventure.svelte b/frontend/src/lib/components/NewAdventure.svelte index 96ac78f..0548027 100644 --- a/frontend/src/lib/components/NewAdventure.svelte +++ b/frontend/src/lib/components/NewAdventure.svelte @@ -24,6 +24,7 @@ import Wikipedia from '~icons/mdi/wikipedia'; import ActivityComplete from './ActivityComplete.svelte'; import { appVersion } from '$lib/config'; + import AdventureCard from './AdventureCard.svelte'; let newAdventure: Adventure = { id: NaN, @@ -294,20 +295,22 @@ >
-
-
- - -
+ {#if newAdventure.type == 'visited' || newAdventure.type == 'planned'} +
+
+ + +
+ {/if}
Lodging + + + + {#each adventures as adventure} + {#if adventure.longitude && adventure.latitude} + + +
{adventure.name}
+

+ {adventure.type.charAt(0).toUpperCase() + adventure.type.slice(1)} +

+

+ {adventure.date + ? new Date(adventure.date).toLocaleDateString('en-US', { timeZone: 'UTC' }) + : ''} +

+
+
+ {/if} + {/each} + +
{/if} {/if}