From d4e4616ba49f3a18a52e3197e1c77639a93b0330 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Tue, 11 Aug 2026 12:38:45 +0200 Subject: feat: Add ride detail map --- web/templates.templ | 66 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 5 deletions(-) (limited to 'web/templates.templ') diff --git a/web/templates.templ b/web/templates.templ index b061f1e..85ee03d 100644 --- a/web/templates.templ +++ b/web/templates.templ @@ -4,10 +4,11 @@ templ Layout(title string, content templ.Component) { - - - { title } · biking_home - @@ -74,7 +81,7 @@ templ RidesContent(items []RideView, headers []RideSortHeader) { for _, item := range items { - { item.Name }
{ item.Type }{ formatRideDate(item.StartDate) }{ formatDistance(item.DistanceM) }{ formatDuration(item.MovingTimeS) }{ formatElevation(item.TotalElevationGainM) }{ item.Cotacol }{ item.CotacolPer100Km } + { item.Name }
{ item.Type }{ formatRideDate(item.StartDate) }{ formatDistance(item.DistanceM) }{ formatDuration(item.MovingTimeS) }{ formatElevation(item.TotalElevationGainM) }{ item.Cotacol }{ item.CotacolPer100Km } } @@ -82,6 +89,55 @@ templ RidesContent(items []RideView, headers []RideSortHeader) { } +templ RideDetailPage(data RideDetailView) { + @Layout("Ride detail", RideDetailContent(data)) +} + +templ RideDetailContent(data RideDetailView) { +

Ride detail

+
+

{ data.Ride.Name }

{ data.Ride.Type } · { formatRideDate(data.Ride.StartDate) }

+ Back to rides +
+
+
+
Distance
{ formatDistance(data.Ride.DistanceM) }
+
Moving time
{ formatDuration(data.Ride.MovingTimeS) }
+
Elevation
{ formatElevation(data.Ride.TotalElevationGainM) }
+
+
+ if data.RouteError != "" { +
{ data.RouteError }
+ } + if data.HasRoute { +
+ +
+ @templ.JSONScript("ride-route", data.Route) + + + } +} + templ SyncPage(data SyncPageData) { @Layout("Sync Strava", SyncContent(data)) } -- cgit v1.2.3