diff --git a/backend/server/worldtravel/migrations/0016_remove_city_insert_id_remove_country_insert_id_and_more.py b/backend/server/worldtravel/migrations/0016_remove_city_insert_id_remove_country_insert_id_and_more.py new file mode 100644 index 0000000..fbc07de --- /dev/null +++ b/backend/server/worldtravel/migrations/0016_remove_city_insert_id_remove_country_insert_id_and_more.py @@ -0,0 +1,25 @@ +# Generated by Django 5.2.1 on 2025-06-14 17:32 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('worldtravel', '0015_city_insert_id_country_insert_id_region_insert_id'), + ] + + operations = [ + migrations.RemoveField( + model_name='city', + name='insert_id', + ), + migrations.RemoveField( + model_name='country', + name='insert_id', + ), + migrations.RemoveField( + model_name='region', + name='insert_id', + ), + ] diff --git a/backend/server/worldtravel/models.py b/backend/server/worldtravel/models.py index 6c7ebb8..9e83f59 100644 --- a/backend/server/worldtravel/models.py +++ b/backend/server/worldtravel/models.py @@ -17,7 +17,6 @@ class Country(models.Model): capital = models.CharField(max_length=100, blank=True, null=True) longitude = models.DecimalField(max_digits=9, decimal_places=6, null=True, blank=True) latitude = models.DecimalField(max_digits=9, decimal_places=6, null=True, blank=True) - insert_id = models.UUIDField(unique=False, blank=True, null=True) class Meta: verbose_name = "Country" @@ -32,7 +31,6 @@ class Region(models.Model): country = models.ForeignKey(Country, on_delete=models.CASCADE) longitude = models.DecimalField(max_digits=9, decimal_places=6, null=True, blank=True) latitude = models.DecimalField(max_digits=9, decimal_places=6, null=True, blank=True) - insert_id = models.UUIDField(unique=False, blank=True, null=True) def __str__(self): return self.name @@ -43,7 +41,6 @@ class City(models.Model): region = models.ForeignKey(Region, on_delete=models.CASCADE) longitude = models.DecimalField(max_digits=9, decimal_places=6, null=True, blank=True) latitude = models.DecimalField(max_digits=9, decimal_places=6, null=True, blank=True) - insert_id = models.UUIDField(unique=False, blank=True, null=True) class Meta: verbose_name_plural = "Cities" diff --git a/frontend/src/lib/components/AdventureCard.svelte b/frontend/src/lib/components/AdventureCard.svelte index c1e3be3..d0f6b98 100644 --- a/frontend/src/lib/components/AdventureCard.svelte +++ b/frontend/src/lib/components/AdventureCard.svelte @@ -277,7 +277,7 @@ on:click={() => goto(`/adventures/${adventure.id}`)} > - View Details + {$t('adventures.open_details')} {#if adventure.user_id == user?.uuid || (collection && user && collection.shared_with?.includes(user.uuid))} diff --git a/frontend/src/lib/components/Avatar.svelte b/frontend/src/lib/components/Avatar.svelte index 5821a9e..28cb952 100644 --- a/frontend/src/lib/components/Avatar.svelte +++ b/frontend/src/lib/components/Avatar.svelte @@ -5,7 +5,6 @@ // Icons import Account from '~icons/mdi/account'; import MapMarker from '~icons/mdi/map-marker'; - import Share from '~icons/mdi/share-variant'; import Shield from '~icons/mdi/shield-account'; import Settings from '~icons/mdi/cog'; import Logout from '~icons/mdi/logout'; @@ -37,12 +36,6 @@ label: 'navbar.my_adventures', section: 'main' }, - { - path: '/shared', - icon: Share, - label: 'navbar.shared_with_me', - section: 'main' - }, { path: '/settings', icon: Settings, diff --git a/frontend/src/routes/+page.svelte b/frontend/src/routes/+page.svelte index 2d987f2..34b18d9 100644 --- a/frontend/src/routes/+page.svelte +++ b/frontend/src/routes/+page.svelte @@ -51,11 +51,11 @@ } ]; - const stats = [ - { label: 'Countries Tracked', value: '195+', icon: GlobeIcon }, - { label: 'Adventures Logged', value: '10K+', icon: CalendarIcon }, - { label: 'Active Travelers', value: '5K+', icon: StarIcon } - ]; + // const stats = [ + // { label: 'Countries Tracked', value: '195+', icon: GlobeIcon }, + // { label: 'Adventures Logged', value: '10K+', icon: CalendarIcon }, + // { label: 'Active Travelers', value: '5K+', icon: StarIcon } + // ];
@@ -167,7 +167,7 @@
-
+
@@ -317,7 +317,7 @@ on:click={() => goto('/signup')} class="btn btn-lg bg-white text-primary hover:bg-white/90 gap-3 shadow-lg group" > - Get Started Free + Get Started - @@ -400,7 +402,7 @@
{#each collections as collection}
- +
{/each}
diff --git a/frontend/src/routes/search/+page.svelte b/frontend/src/routes/search/+page.svelte index 1e96cbb..e0ba98e 100644 --- a/frontend/src/routes/search/+page.svelte +++ b/frontend/src/routes/search/+page.svelte @@ -18,6 +18,7 @@ VisitedRegion, VisitedCity } from '$lib/types'; + import SearchIcon from '~icons/mdi/magnify'; export let data: PageData; @@ -34,71 +35,171 @@ $: cities = data.cities as City[]; $: visited_regions = data.visited_regions as VisitedRegion[]; $: visited_cities = data.visited_cities as VisitedCity[]; + + // new stats + $: totalResults = + adventures.length + + collections.length + + users.length + + countries.length + + regions.length + + cities.length; + $: hasResults = totalResults > 0; -

Search{query ? `: ${query}` : ''}

- -{#if adventures.length > 0} -

Adventures

-
- {#each adventures as adventure} - - {/each} -
-{/if} - -{#if collections.length > 0} -

Collections

-
- {#each collections as collection} - - {/each} -
-{/if} - -{#if countries.length > 0} -

Countries

-
- {#each countries as country} - - {/each} -
-{/if} - -{#if regions.length > 0} -

Regions

-
- {#each regions as region} - vr.region === region.id)} /> - {/each} -
-{/if} - -{#if cities.length > 0} -

Cities

-
- {#each cities as city} - vc.city === city.id)} /> - {/each} -
-{/if} - -{#if users.length > 0} -

Users

-
- {#each users as user} - - {/each} -
-{/if} - -{#if adventures.length === 0 && regions.length === 0 && cities.length === 0 && countries.length === 0 && collections.length === 0 && users.length === 0} -

- {$t('adventures.no_results')} -

-{/if} - Search: {query} + +
+ +
+
+
+
+ +
+
+

+ Search{query ? `: ${query}` : ''} +

+ {#if hasResults} +

+ {totalResults} result{totalResults !== 1 ? 's' : ''} found +

+ {/if} +
+
+
+
+ + +
+ {#if !hasResults} +
+
+ +
+

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

+

+ Try searching for adventures, collections, countries, regions, cities, or users. +

+
+ {:else} + {#if adventures.length > 0} +
+
+
+ +
+

Adventures

+
{adventures.length}
+
+
+ {#each adventures as adventure} + + {/each} +
+
+ {/if} + + {#if collections.length > 0} +
+
+
+ + +
+

Collections

+
{collections.length}
+
+
+ {#each collections as collection} + + {/each} +
+
+ {/if} + + {#if countries.length > 0} +
+
+
+ + +
+

Countries

+
{countries.length}
+
+
+ {#each countries as country} + + {/each} +
+
+ {/if} + + {#if regions.length > 0} +
+
+
+ + +
+

Regions

+
{regions.length}
+
+
+ {#each regions as region} + vr.region === region.id)} + /> + {/each} +
+
+ {/if} + + {#if cities.length > 0} +
+
+
+ + +
+

Cities

+
{cities.length}
+
+
+ {#each cities as city} + vc.city === city.id)} /> + {/each} +
+
+ {/if} + + {#if users.length > 0} +
+
+
+ + +
+

Users

+
{users.length}
+
+
+ {#each users as user} + + {/each} +
+
+ {/if} + {/if} +
+
diff --git a/frontend/src/routes/shared/+page.server.ts b/frontend/src/routes/shared/+page.server.ts deleted file mode 100644 index d5c1337..0000000 --- a/frontend/src/routes/shared/+page.server.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { redirect } from '@sveltejs/kit'; -import type { PageServerLoad } from './$types'; - -const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL']; -const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000'; - -export const load = (async (event) => { - if (!event.locals.user) { - return redirect(302, '/login'); - } else { - let sessionId = event.cookies.get('sessionid'); - let res = await fetch(`${serverEndpoint}/api/collections/shared/`, { - headers: { - Cookie: `sessionid=${sessionId}` - } - }); - if (!res.ok) { - return redirect(302, '/login'); - } else { - return { - props: { - collections: await res.json() - } - }; - } - } -}) satisfies PageServerLoad; diff --git a/frontend/src/routes/shared/+page.svelte b/frontend/src/routes/shared/+page.svelte deleted file mode 100644 index 6207c15..0000000 --- a/frontend/src/routes/shared/+page.svelte +++ /dev/null @@ -1,34 +0,0 @@ - - -{#if collections.length > 0} -
- {#each collections as collection} - - {/each} -
-{:else} -

- {$t('share.no_shared_found')} - {#if data.user && !data.user?.public_profile} -

{$t('share.set_public')}

- - {/if} -

-{/if} - - - Shared Collections - - diff --git a/frontend/src/routes/worldtravel/[id]/+page.svelte b/frontend/src/routes/worldtravel/[id]/+page.svelte index 43b9214..04af5c4 100644 --- a/frontend/src/routes/worldtravel/[id]/+page.svelte +++ b/frontend/src/routes/worldtravel/[id]/+page.svelte @@ -208,20 +208,6 @@ {/if} - - - @@ -262,53 +248,55 @@ -
-
-
-
-
- -

Interactive Map

-
-
-
-
- Visited + {#if regions.some((region) => region.latitude && region.longitude)} +
+
+
+
+
+ +

Interactive Map

-
-
- Not Visited +
+
+
+ Visited +
+
+
+ Not Visited +
+ + {#each regions as region} + {#if region.latitude && region.longitude && showGeo} + + + {region.name} + + + {/if} + {/each} +
- - {#each regions as region} - {#if region.latitude && region.longitude && showGeo} - - - {region.name} - - - {/if} - {/each} -
-
+ {/if}
@@ -329,7 +317,7 @@ {:else}
{#each filteredRegions as region} --> -
- + {#if regions.some((region) => region.latitude && region.longitude)} +
+ - -
+
+ {/if}