From bef31e1d35fe88f2698cf0e3191f26a79623f66f Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Wed, 5 Aug 2026 11:21:55 +0200 Subject: feat: Add web ride library with Strava sync --- web/templates.templ | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 web/templates.templ (limited to 'web/templates.templ') diff --git a/web/templates.templ b/web/templates.templ new file mode 100644 index 0000000..d0b1c0c --- /dev/null +++ b/web/templates.templ @@ -0,0 +1,106 @@ +package web + +templ Layout(title string, content templ.Component) { + + + + + + { title } ยท biking_home + + + + +
+ @content +
+ + +} + +templ RidesPage(items []RideView) { + @Layout("Rides", RidesContent(items)) +} + +templ RidesContent(items []RideView) { +

Ride library

+
+

All rides

Your imported rides, ready for climb analysis.

+ Sync Strava +
+
+ if len(items) == 0 { +
No rides stored yet. Import your first Strava rides.
+ } else { + + + + for _, item := range items { + + } + +
RideStartedDistanceMoving timeElevationCotacolCotacol / 100 km
{ item.Name }
{ item.Type }
{ formatRideDate(item.StartDate) }{ formatDistance(item.DistanceM) }{ formatDuration(item.MovingTimeS) }{ formatElevation(item.TotalElevationGainM) }{ item.Cotacol }{ item.CotacolPer100Km }
+ } +
+} + +templ SyncPage(data SyncPageData) { + @Layout("Sync Strava", SyncContent(data)) +} + +templ SyncContent(data SyncPageData) { +

Data import

+

Sync Strava rides

+

Choose a date range. New rides are downloaded as GPX files and recorded in the local library.

+ if data.Notice != "" { +
{ data.Notice }
+ } + if data.Error != "" { +
{ data.Error }
+ } +
+ if !data.HasAuth { +

Strava authorization is required before the first sync.

+ Authorize Strava + } else { +
+
+ + + +
+
+ } +
+} -- cgit v1.2.3