From 0c3507139795c3117bcdf82ca4b444e934bd3c74 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Sun, 16 Aug 2026 10:31:32 +0200 Subject: feat(web): improve ride detail climb profiles --- web/templates.templ | 120 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 47 deletions(-) (limited to 'web/templates.templ') diff --git a/web/templates.templ b/web/templates.templ index 9ebeedb..c640171 100644 --- a/web/templates.templ +++ b/web/templates.templ @@ -71,60 +71,85 @@ templ RideDetailContent(data RideDetailView) {
{ data.ActionError }
}
-
-
-
-
Distance
{ formatDistance(data.Ride.DistanceM) }
-
Moving time
{ formatDuration(data.Ride.MovingTimeS) }
-
Elevation
{ formatElevation(data.Ride.TotalElevationGainM) }
-
-
- if data.HasRoute { +
+
+
Distance
{ formatDistance(data.Ride.DistanceM) }
+
Moving time
{ formatDuration(data.Ride.MovingTimeS) }
+
Elevation
{ formatElevation(data.Ride.TotalElevationGainM) }
+
+
+ if data.HasRoute { + if len(data.Profile.OfficialClimbs) > 0 { +
+
+

Official climbs

+
+
+ for _, climb := range data.Profile.OfficialClimbs { +
+ + Climb { formatClimbNumber(climb.Index) }{ climb.OfficialName } +
+
Length
{ formatProfileDistance(climb.DistanceKm) }
+
Cotacol
{ formatCotacol(climb.Cotacol) }
+
Avg slope
{ formatSlope(climb.SlopePercent) }
+
+ +
+
+ +
+ Downhill + 0–3% + 3–6% + 6–9% + 9–12% + 12%+ +
+
+
+ } +
+
+ } +
+ if len(data.Profile.UnmatchedClimbs) > 0 {
- if len(data.Profile.Climbs) > 0 { - - } - if len(data.Profile.Climbs) == 0 { -

No climbs detected in this ride.

- } - if len(data.Profile.Climbs) > 0 { -
- for index, climb := range data.Profile.Climbs { -
+
+

Next steps

Climbs to match

+ { formatClimbCount(len(data.Profile.UnmatchedClimbs)) } +
+ +
+ for _, climb := range data.Profile.UnmatchedClimbs { +
- Climb { formatClimbNumber(index) }{ climb.Name } + Climb { formatClimbNumber(climb.Index) }{ climb.Name } { formatProfileDistance(climb.StartKm) }–{ formatProfileDistance(climb.EndKm) }

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

- if climb.OfficialClimbID > 0 { -

Official climb matched: { climb.OfficialName }

- } else { -

No official climb matched yet.

-
- - - -
-
Start
{ formatProfileDistance(climb.StartKm) }
-
End
{ formatProfileDistance(climb.EndKm) }
-
- Preview the corrected climb boundaries. - -
- } +

Waiting for an official climb match.

+
+ + + +
+
Start
{ formatProfileDistance(climb.StartKm) }
+
End
{ formatProfileDistance(climb.EndKm) }
+
+ Preview the corrected climb boundaries. + +
- } -
- } + } +
- } -
- if data.HasRoute { -
+ } +

Elevation profile

@@ -138,6 +163,7 @@ templ RideDetailContent(data RideDetailView) {
+
}
-- cgit v1.2.3