Closed pixelspark closed 1 month ago
I would suggest to use an actual Go function here, similar to the preferred units. This would be useful in other places, like the "details" in the workout list table (which now only shows speed).
Yeah, that was my first attempt, but I abandoned that as (1) the function needs access to both the user profile (preferred units), workout type, and the speed value, which is a bit cumbersome, and (2) it's generating HTML (<abbr title=...>
) and it didn't seem very clean to put this on the Go side. Also (3) the templates functions couldn't import the UserPreferredUnits struct due to some stupid import loop (probably fixable).
If you prefer though I can change it to a function, it would then become something like this:
{{ HumanTempoOrSpeed .AverageSpeed.Value .WorkoutType.String .UserPreferredUnits }}
I'll give it a little try myself first...
By the way, translations are via Weblate now
I would appreciate you taking a look at / testing out my version...
Tempo makes more sense for running.