From 6add399c3cb1b9a78e937026362339d45659ac9f Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Fri, 13 Oct 2023 20:18:02 +1100 Subject: [PATCH] Format workout stats better --- app.py | 2 +- .../partials/workouts_list_fragment.html | 85 +++++++++++++++++-- 2 files changed, 77 insertions(+), 10 deletions(-) diff --git a/app.py b/app.py index 66e5aca..81bb1c6 100644 --- a/app.py +++ b/app.py @@ -396,7 +396,7 @@ def get_workouts_for_user(user_id, max_date=None): 'start_time': format_date_with_ordinal(start_time, '%#H:%M %B %dth %Y'), 'start_time_date': start_time, 'start_time_ago': humanize.naturaltime(start_time), - 'duration': format_duration(duration), + 'duration': humanize.naturaldelta(duration), 'duration_minutes': duration.total_seconds() / 60, 'average_rpm': int(average_rpm), 'min_rpm': int(min_rpm), diff --git a/templates/partials/workouts_list_fragment.html b/templates/partials/workouts_list_fragment.html index 97ef02f..655dafe 100644 --- a/templates/partials/workouts_list_fragment.html +++ b/templates/partials/workouts_list_fragment.html @@ -17,15 +17,82 @@
-
Duration: {{ w.duration }} - | - Average RPM: {{ w.average_rpm - }} | - Calories: {{ w.calories }} | Distance: {{ w.distance }} {% if w.is_heart_rate_available - %} | Average: BPM: {{w.average_bpm }} {% endif %}{{ - w.bike_display_name }}
+ +
+
+ + + + {{ w.duration }} +
+
+ + + + {{ w.average_rpm + }} RPM +
+ {% if w.is_heart_rate_available %} +
+ + + + {{w.average_bpm }} BPM +
+ {% endif %} +
+ + + + {{ w.distance }} KM +
+
+ + + + + + + {{ w.calories }} CALS +
+
+ + + + {{ + w.bike_display_name }} +
+
+