From 8e0c55230ef59869bda1ca19ca8697b447d57698 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Sun, 6 Sep 2026 12:38:16 +0200 Subject: Preview: analyze a raw GPX or FIT file without persisting it --- web/templates.templ | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'web/templates.templ') diff --git a/web/templates.templ b/web/templates.templ index 14f8d69..14e9aab 100644 --- a/web/templates.templ +++ b/web/templates.templ @@ -15,7 +15,7 @@ templ Layout(title string, content templ.Component) {
@content @@ -200,6 +200,25 @@ templ AnalyticsContent(data AnalyticsPageData) { } +templ PreviewPage(data PreviewPageData) { + @Layout("Preview", PreviewContent(data)) +} + +templ PreviewContent(data PreviewPageData) { +
+

Preview a ride file

Analyze a GPX or FIT file without importing it: climbs, official climb matches and mountain-pass crossings.

+
+ if data.Error != "" { +
{ data.Error }
+ } +
+
+ + +
+
+} + templ RideDetailPage(data RideDetailView) { @Layout("Ride detail", RideDetailContent(data)) } @@ -233,7 +252,8 @@ templ RideDetailContent(data RideDetailView) {
Cotacol
{ data.Cotacol }
-
+ if !data.Preview { +
@@ -260,9 +280,10 @@ templ RideDetailContent(data RideDetailView) {
- -
+ +
+ } if data.HasRoute { if len(data.Profile.OfficialClimbs()) > 0 {
@@ -317,7 +338,7 @@ templ RideDetailContent(data RideDetailView) {

{ climb.Category } · { formatProfileDistance(climb.DistanceKm) } at { formatSlope(climb.SlopePercent) } · Cotacol { formatCotacol(climb.Cotacol) }

Waiting for an official climb match.

-
+ -- cgit v1.3