diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index dd2b5c2d..2b9bdc15 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -1010,7 +1010,8 @@ "show_trails": "Show trail tracks", "hide_trails": "Hide trail tracks", "fullscreen_failed": "Could not toggle fullscreen.", - "map_style": "Map style" + "map_style": "Map style", + "stats": "Stats" }, "share": { "shared": "Shared", @@ -1077,7 +1078,6 @@ "dashboard": { "welcome_back": "Welcome back", "countries_visited": "Countries Visited", - "total_adventures": "Total Adventures", "total_visited_regions": "Total Visited Regions", "total_visited_cities": "Total Visited Cities", "recent_adventures": "Recent Adventures", diff --git a/frontend/src/routes/map/+page.svelte b/frontend/src/routes/map/+page.svelte index 56e5a27a..27954acf 100644 --- a/frontend/src/routes/map/+page.svelte +++ b/frontend/src/routes/map/+page.svelte @@ -46,7 +46,9 @@ import MapDetailPanel from '$lib/components/map/MapDetailPanel.svelte'; import MapRecommendationsLayer from '$lib/components/map/MapRecommendationsLayer.svelte'; import MapFloatingControls from '$lib/components/map/MapFloatingControls.svelte'; + import CategoryFilterDropdown from '$lib/components/CategoryFilterDropdown.svelte'; import Compass from '~icons/mdi/compass'; + import Tag from '~icons/mdi/tag'; export let data; @@ -79,6 +81,7 @@ let showVisited = true; let showPlanned = true; + let typeString = ''; let searchMode: MapSearchMode = 'my'; let searchQuery = ''; let selected: MapSelection | null = null; @@ -184,6 +187,7 @@ $: visitedAdventures = pins.filter((pin) => pin.is_visited).length; $: plannedAdventures = pins.filter((pin) => !pin.is_visited).length; $: totalRegions = visitedRegions.length; + $: categoryFilterNames = typeString ? typeString.split(',').filter((item) => item !== '') : []; $: isMetric = data.user?.measurement_system !== 'imperial'; $: recRadiusOptions = isMetric @@ -210,6 +214,10 @@ const statusMatch = (showVisited && pin.is_visited === true) || (showPlanned && pin.is_visited !== true); if (!statusMatch) return false; + if (categoryFilterNames.length > 0) { + const categoryName = pin.category?.name; + if (!categoryName || !categoryFilterNames.includes(categoryName)) return false; + } if (!query) return true; return ( pin.name?.toLowerCase().includes(query) || @@ -936,11 +944,14 @@ >
{$t('map.map_controls')}
-
-
+
+

- {$t('map.adventure_stats')} + {$t('map.stats')}

-
-
-
{$t('dashboard.total_adventures')}
-
{totalAdventures}
-
-
-
-
{$t('adventures.visited')}
-
{visitedAdventures}
+
+
+
+ {$t('locations.locations')}
-
-
{$t('adventures.planned')}
-
{plannedAdventures}
+
{totalAdventures}
+
+
+
+ {$t('adventures.visited')} +
+
+ {visitedAdventures}
- {#if totalAdventures > 0} - - {/if} +
+
+ {$t('adventures.planned')} +
+
{plannedAdventures}
+
+ {#if totalAdventures > 0} + + {/if}
{#if searchMode === 'nearby'} @@ -1142,6 +1159,14 @@
{/if} +
+

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

+ +
+