- {#each adventures as adventure}
-
- {/each}
+
- {#if transportations.length > 0}
-
{$t('adventures.transportations')}
-
- {#each transportations as transportation}
- {
- transportations = transportations.filter((t) => t.id != event.detail);
- }}
- on:edit={editTransportation}
- {collection}
- />
- {/each}
-
- {/if}
+ {#if currentView == 'all'}
+ {#if adventures.length > 0}
+
{$t('adventures.linked_adventures')}
- {#if notes.length > 0}
-
{$t('adventures.notes')}
-
- {#each notes as note}
- {
- noteToEdit = event.detail;
- isNoteModalOpen = true;
- }}
- on:delete={(event) => {
- notes = notes.filter((n) => n.id != event.detail);
- }}
- {collection}
- />
- {/each}
-
- {/if}
+
+ {#each adventures as adventure}
+
+ {/each}
+
+ {/if}
- {#if checklists.length > 0}
-
{$t('adventures.checklists')}
-
- {#each checklists as checklist}
- {
- checklists = checklists.filter((n) => n.id != event.detail);
- }}
- on:edit={(event) => {
- checklistToEdit = event.detail;
- isShowingChecklistModal = true;
- }}
- {collection}
- />
- {/each}
-
+ {#if transportations.length > 0}
+
{$t('adventures.transportations')}
+
+ {#each transportations as transportation}
+ {
+ transportations = transportations.filter((t) => t.id != event.detail);
+ }}
+ on:edit={editTransportation}
+ {collection}
+ />
+ {/each}
+
+ {/if}
+
+ {#if notes.length > 0}
+
{$t('adventures.notes')}
+
+ {#each notes as note}
+ {
+ noteToEdit = event.detail;
+ isNoteModalOpen = true;
+ }}
+ on:delete={(event) => {
+ notes = notes.filter((n) => n.id != event.detail);
+ }}
+ {collection}
+ />
+ {/each}
+
+ {/if}
+
+ {#if checklists.length > 0}
+
{$t('adventures.checklists')}
+
+ {#each checklists as checklist}
+ {
+ checklists = checklists.filter((n) => n.id != event.detail);
+ }}
+ on:edit={(event) => {
+ checklistToEdit = event.detail;
+ isShowingChecklistModal = true;
+ }}
+ {collection}
+ />
+ {/each}
+
+ {/if}
{/if}
{#if collection.start_date && collection.end_date}
-
-
-
-
{$t('adventures.itineary_by_date')}
- {#if numberOfDays}
-
- {$t('adventures.duration')}:
- {numberOfDays} {$t('adventures.days')}
-
- {/if}
-
- Dates: {new Date(collection.start_date).toLocaleDateString(undefined, { timeZone: 'UTC' })} -
- {new Date(collection.end_date).toLocaleDateString(undefined, {
- timeZone: 'UTC'
- })}
-
-
-
-
-
-
- {#each Array(numberOfDays) as _, i}
- {@const startDate = new Date(collection.start_date)}
- {@const tempDate = new Date(startDate.getTime())}
- {@const adjustedDate = new Date(tempDate.setUTCDate(tempDate.getUTCDate() + i))}
- {@const dateString = adjustedDate.toISOString().split('T')[0]}
-
- {@const dayAdventures =
- groupAdventuresByDate(adventures, new Date(collection.start_date), numberOfDays)[
- dateString
- ] || []}
- {@const dayTransportations =
- groupTransportationsByDate(
- transportations,
- new Date(collection.start_date),
- numberOfDays
- )[dateString] || []}
- {@const dayNotes =
- groupNotesByDate(notes, new Date(collection.start_date), numberOfDays)[dateString] || []}
- {@const dayChecklists =
- groupChecklistsByDate(checklists, new Date(collection.start_date), numberOfDays)[
- dateString
- ] || []}
-
-
-
-
- {$t('adventures.day')}
- {i + 1}
-
- {adjustedDate.toLocaleDateString(undefined, { timeZone: 'UTC' })}
-
-
-
-
-
-
- {#if dayAdventures.length > 0}
- {#each dayAdventures as adventure}
-
- {/each}
- {/if}
- {#if dayTransportations.length > 0}
- {#each dayTransportations as transportation}
-
{
- transportations = transportations.filter((t) => t.id != event.detail);
- }}
- on:edit={(event) => {
- transportationToEdit = event.detail;
- isShowingTransportationModal = true;
- }}
- />
- {/each}
- {/if}
- {#if dayNotes.length > 0}
- {#each dayNotes as note}
- {
- noteToEdit = event.detail;
- isNoteModalOpen = true;
- }}
- on:delete={(event) => {
- notes = notes.filter((n) => n.id != event.detail);
- }}
- />
- {/each}
- {/if}
- {#if dayChecklists.length > 0}
- {#each dayChecklists as checklist}
- {
- notes = notes.filter((n) => n.id != event.detail);
- }}
- on:edit={(event) => {
- checklistToEdit = event.detail;
- isShowingChecklistModal = true;
- }}
- />
- {/each}
- {/if}
-
-
- {#if dayAdventures.length == 0 && dayTransportations.length == 0 && dayNotes.length == 0 && dayChecklists.length == 0}
-
{$t('adventures.nothing_planned')}
+ {#if currentView == 'itinerary'}
+
+
+
+
{$t('adventures.itineary_by_date')}
+ {#if numberOfDays}
+
+ {$t('adventures.duration')}:
+ {numberOfDays} {$t('adventures.days')}
+
{/if}
+
+ Dates: {new Date(collection.start_date).toLocaleDateString(undefined, {
+ timeZone: 'UTC'
+ })} -
+ {new Date(collection.end_date).toLocaleDateString(undefined, {
+ timeZone: 'UTC'
+ })}
+
- {/each}
-
-
-
-
-
Trip Map
-
- {#each adventures as adventure}
- {#if adventure.longitude && adventure.latitude}
-
-
- {adventure.name}
-
- {adventure.category?.display_name + ' ' + adventure.category?.icon}
-
-
-
- {/if}
- {/each}
- {#each transportations as transportation}
- {#if transportation.destination_latitude && transportation.destination_longitude}
-
-
- {getTransportationEmoji(transportation.type)}
-
-
- {transportation.name}
-
- {transportation.type}
-
-
-
- {/if}
- {#if transportation.origin_latitude && transportation.origin_longitude}
-
-
- {getTransportationEmoji(transportation.type)}
-
-
- {transportation.name}
-
- {transportation.type}
-
-
-
- {/if}
- {/each}
-
-
+
+
+ {#each Array(numberOfDays) as _, i}
+ {@const startDate = new Date(collection.start_date)}
+ {@const tempDate = new Date(startDate.getTime())}
+ {@const adjustedDate = new Date(tempDate.setUTCDate(tempDate.getUTCDate() + i))}
+ {@const dateString = adjustedDate.toISOString().split('T')[0]}
+
+ {@const dayAdventures =
+ groupAdventuresByDate(adventures, new Date(collection.start_date), numberOfDays)[
+ dateString
+ ] || []}
+ {@const dayTransportations =
+ groupTransportationsByDate(
+ transportations,
+ new Date(collection.start_date),
+ numberOfDays
+ )[dateString] || []}
+ {@const dayNotes =
+ groupNotesByDate(notes, new Date(collection.start_date), numberOfDays)[dateString] ||
+ []}
+ {@const dayChecklists =
+ groupChecklistsByDate(checklists, new Date(collection.start_date), numberOfDays)[
+ dateString
+ ] || []}
+
+
+
+
+ {$t('adventures.day')}
+ {i + 1}
+
+ {adjustedDate.toLocaleDateString(undefined, { timeZone: 'UTC' })}
+
+
+
+
+
+
+ {#if dayAdventures.length > 0}
+ {#each dayAdventures as adventure}
+
+ {/each}
+ {/if}
+ {#if dayTransportations.length > 0}
+ {#each dayTransportations as transportation}
+
{
+ transportations = transportations.filter((t) => t.id != event.detail);
+ }}
+ on:edit={(event) => {
+ transportationToEdit = event.detail;
+ isShowingTransportationModal = true;
+ }}
+ />
+ {/each}
+ {/if}
+ {#if dayNotes.length > 0}
+ {#each dayNotes as note}
+ {
+ noteToEdit = event.detail;
+ isNoteModalOpen = true;
+ }}
+ on:delete={(event) => {
+ notes = notes.filter((n) => n.id != event.detail);
+ }}
+ />
+ {/each}
+ {/if}
+ {#if dayChecklists.length > 0}
+ {#each dayChecklists as checklist}
+ {
+ notes = notes.filter((n) => n.id != event.detail);
+ }}
+ on:edit={(event) => {
+ checklistToEdit = event.detail;
+ isShowingChecklistModal = true;
+ }}
+ />
+ {/each}
+ {/if}
+
+
+ {#if dayAdventures.length == 0 && dayTransportations.length == 0 && dayNotes.length == 0 && dayChecklists.length == 0}
+
{$t('adventures.nothing_planned')}
+ {/if}
+
+
+ {/each}
+
+ {/if}
+
+ {#if currentView == 'map'}
+
+
+
Trip Map
+
+ {#each adventures as adventure}
+ {#if adventure.longitude && adventure.latitude}
+
+
+ {adventure.name}
+
+ {adventure.category?.display_name + ' ' + adventure.category?.icon}
+
+
+
+ {/if}
+ {/each}
+ {#each transportations as transportation}
+ {#if transportation.destination_latitude && transportation.destination_longitude}
+
+
+ {getTransportationEmoji(transportation.type)}
+
+
+ {transportation.name}
+
+ {transportation.type}
+
+
+
+ {/if}
+ {#if transportation.origin_latitude && transportation.origin_longitude}
+
+
+ {getTransportationEmoji(transportation.type)}
+
+
+ {transportation.name}
+
+ {transportation.type}
+
+
+
+ {/if}
+ {/each}
+
+
+
+ {/if}
+ {#if currentView == 'calendar'}
+
+
+
+ {$t('adventures.adventure_calendar')}
+
+
+
+
+ {/if}
{/if}
{/if}
diff --git a/frontend/src/routes/profile/+page.svelte b/frontend/src/routes/profile/+page.svelte
index d57df6b..8722c26 100644
--- a/frontend/src/routes/profile/+page.svelte
+++ b/frontend/src/routes/profile/+page.svelte
@@ -11,82 +11,88 @@
total_countries: number;
} | null;
- if (data.stats) {
- stats = data.stats;
- } else {
- stats = null;
- }
- console.log(stats);
+ stats = data.stats || null;
-{#if data.user.profile_pic}
-
-
-
-

-
+
+
+
+ {#if data.user.profile_pic}
+
+
+

+
+
+ {/if}
+
+
+ {#if data.user && data.user.first_name && data.user.last_name}
+
+ {data.user.first_name}
+ {data.user.last_name}
+
+ {/if}
+
{data.user.username}
+
+
+ {#if data.user && data.user.date_joined}
+
+
{$t('profile.member_since')}
+
+
+
+ {new Date(data.user.date_joined).toLocaleDateString(undefined, { timeZone: 'UTC' })}
+
+
+
+ {/if}
-{/if}
-{#if data.user && data.user.first_name && data.user.last_name}
-
- {data.user.first_name}
- {data.user.last_name}
-
-{/if}
-{data.user.username}
+
+ {#if stats}
+
-{#if data.user && data.user.date_joined}
- {$t('profile.member_since')}
-
-
-
- {new Date(data.user.date_joined).toLocaleDateString(undefined, { timeZone: 'UTC' })}
-
-
-{/if}
+
+ {$t('profile.user_stats')}
+
-{#if stats}
-
-
-
- {$t('profile.user_stats')}
-
-
-
-
-
{$t('navbar.adventures')}
-
{stats.adventure_count}
-
-
-
-
{$t('navbar.collections')}
-
{stats.trips_count}
-
-
-
-
-
{$t('profile.visited_countries')}
-
- {Math.round((stats.country_count / stats.total_countries) * 100)}%
+
+
+
+
{$t('navbar.adventures')}
+
{stats.adventure_count}
-
- {stats.country_count}/{stats.total_countries}
-
-
-
-
{$t('profile.visited_regions')}
-
- {Math.round((stats.visited_region_count / stats.total_regions) * 100)}%
+
+
{$t('navbar.collections')}
+
{stats.trips_count}
-
- {stats.visited_region_count}/{stats.total_regions}
+
+
+
{$t('profile.visited_countries')}
+
+ {Math.round((stats.country_count / stats.total_countries) * 100)}%
+
+
+ {stats.country_count}/{stats.total_countries}
+
+
+
+
+
{$t('profile.visited_regions')}
+
+ {Math.round((stats.visited_region_count / stats.total_regions) * 100)}%
+
+
+ {stats.visited_region_count}/{stats.total_regions}
+
-
-{/if}
+ {/if}
+
Profile | AdventureLog
diff --git a/frontend/src/routes/user/reset-password/+page.svelte b/frontend/src/routes/user/reset-password/+page.svelte
index 873e778..7cd1803 100644
--- a/frontend/src/routes/user/reset-password/+page.svelte
+++ b/frontend/src/routes/user/reset-password/+page.svelte
@@ -4,32 +4,47 @@
import { t } from 'svelte-i18n';
-
+
+ {$t('settings.reset_password')}
-