diff --git a/db.py b/db.py index 06b5252..c81e795 100644 --- a/db.py +++ b/db.py @@ -427,6 +427,11 @@ class DataBase(): start_dates = [t['start_date'] for t in topsets] messages = [f'{t["repetitions"]} x {t["weight"]}kg ({t["estimated_1rm"]}kg E1RM) on {t["start_date"].strftime("%d %b %y")}' for t in topsets] + # Get the latest topset info for badges + latest_topset = topsets[-1] + latest_topset_id = latest_topset['topset_id'] + latest_workout_id = latest_topset['workout_id'] + exercise_progress = get_exercise_graph_model( exercise_name, estimated_1rm, @@ -440,6 +445,9 @@ class DataBase(): min_date, max_date, degree) + + exercise_progress['latest_topset_id'] = latest_topset_id + exercise_progress['latest_workout_id'] = latest_workout_id return exercise_progress diff --git a/templates/partials/sparkline.html b/templates/partials/sparkline.html index 340d89b..dd4d427 100644 --- a/templates/partials/sparkline.html +++ b/templates/partials/sparkline.html @@ -46,7 +46,12 @@ -

{{ title }}

+
+

{{ title }}

+
+
+

{% if best_fit_formula %} {{ best_fit_formula.kg_per_week }} kg/week, {{ best_fit_formula.kg_per_month }} kg/month