diff --git a/backend/server/integrations/views/strava_view.py b/backend/server/integrations/views/strava_view.py index 0ce3086..27b63c6 100644 --- a/backend/server/integrations/views/strava_view.py +++ b/backend/server/integrations/views/strava_view.py @@ -92,7 +92,7 @@ class StravaIntegrationView(viewsets.ViewSet): frontend_url = settings.FRONTEND_URL if not frontend_url.endswith('/'): frontend_url += '/' - return redirect(f"{frontend_url}settings?strava_authorized=true") + return redirect(f"{frontend_url}settings?tab=integrations") except requests.RequestException as e: diff --git a/frontend/src/lib/assets/wanderer.svg b/frontend/src/lib/assets/wanderer.svg new file mode 100644 index 0000000..22d43c5 --- /dev/null +++ b/frontend/src/lib/assets/wanderer.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/routes/settings/+page.svelte b/frontend/src/routes/settings/+page.svelte index ed4c6dc..4dfdd3e 100644 --- a/frontend/src/routes/settings/+page.svelte +++ b/frontend/src/routes/settings/+page.svelte @@ -11,6 +11,7 @@ import ImmichLogo from '$lib/assets/immich.svg'; import GoogleMapsLogo from '$lib/assets/google_maps.svg'; import StravaLogo from '$lib/assets/strava.svg'; + import WandererLogo from '$lib/assets/wanderer.svg'; export let data; console.log(data); @@ -28,6 +29,23 @@ let stravaGlobalEnabled = data.props.stravaGlobalEnabled; let stravaUserEnabled = data.props.stravaUserEnabled; let activeSection: string = 'profile'; + + // Initialize activeSection from URL on mount + onMount(() => { + if (browser && $page.url.searchParams.has('tab')) { + activeSection = $page.url.searchParams.get('tab') || 'profile'; + } + }); + + function setActiveSection(sectionId: string) { + activeSection = sectionId; + if (browser) { + const url = new URL($page.url); + url.searchParams.set('tab', sectionId); + history.replaceState({}, '', url); + } + } + let acknowledgeRestoreOverride: boolean = false; let newImmichIntegration: ImmichIntegration = { @@ -343,7 +361,7 @@ section.id ? 'bg-primary text-primary-content shadow-lg' : 'hover:bg-base-200'}" - on:click={() => (activeSection = section.id)} + on:click={() => setActiveSection(section.id)} > {section.icon} {section.label()} @@ -965,7 +983,7 @@ -
+
Strava
@@ -1026,6 +1044,71 @@
{/if}
+ +
+
+
+
+

Wanderer

+

+ {$t('strava.strava_integration_desc')} +

+
+ {#if stravaGlobalEnabled && stravaUserEnabled} +
{$t('settings.connected')}
+ {:else} +
{$t('settings.disconnected')}
+ {/if} +
+ + + {#if !stravaGlobalEnabled} + +
+

+ {$t('strava.not_enabled') || + 'Strava integration is not enabled on this instance.'} +

+
+ {:else if !stravaUserEnabled && stravaGlobalEnabled} + +
+ +
+ {:else if stravaGlobalEnabled && stravaUserEnabled} + +
+ +
+ {/if} + + + {#if user.is_staff || !stravaGlobalEnabled} +
+ {#if user.is_staff} +

+ 📖 {$t('immich.need_help')} + {$t('navbar.documentation')} +

+ {:else if !stravaGlobalEnabled} +

+ â„šī¸ {$t('google_maps.google_maps_integration_desc_no_staff')} +

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