From 1e63f5c91f0e5ff7dfc582b67d262d5939cc34bc Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Fri, 21 Aug 2026 19:02:05 +0200 Subject: Add global analytics page shell and split server.go by concern --- web/templates.templ | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'web/templates.templ') diff --git a/web/templates.templ b/web/templates.templ index 9e143b4..1cda7f2 100644 --- a/web/templates.templ +++ b/web/templates.templ @@ -13,7 +13,7 @@ templ Layout(title string, content templ.Component) {
@content @@ -117,6 +117,26 @@ templ RidesContent(data RidesPageData) { } +templ AnalyticsPage(data AnalyticsPageData) { + @Layout("Analytics", AnalyticsContent(data)) +} + +templ AnalyticsContent(data AnalyticsPageData) { +

Analytics

+

Ride analytics

+

One point per ride: average speed on the x axis, Cotacol per 100 km on the y axis.

+
+

Chart

Speed vs. Cotacol per 100 km

+ if len(data.Points) == 0 { +
No eligible rides yet. Import rides to see the chart.
+ } else { +
+ } +
+ @templ.JSONScript("analytics-points", data.Points) + +} + templ RideDetailPage(data RideDetailView) { @Layout("Ride detail", RideDetailContent(data)) } -- cgit v1.3