diff --git a/app.py b/app.py index 3d9669f..81b2d1b 100644 --- a/app.py +++ b/app.py @@ -399,8 +399,8 @@ def get_most_recent_topset_for_exercise(person_id, workout_id): if not topset: return render_template('partials/new_set_form.html', person_id=person_id, workout_id=workout_id, exercises=exercises, exercise_id=exercise_id, has_value=False) - (repetitions, weight) = topset - return render_template('partials/new_set_form.html', person_id=person_id, workout_id=workout_id, exercises=exercises, has_value=True, exercise_id=exercise_id, repetitions=repetitions, weight=weight) + (repetitions, weight, exercise_name) = topset + return render_template('partials/new_set_form.html', person_id=person_id, workout_id=workout_id, has_value=True, exercise_id=exercise_id, exercise_name=exercise_name, repetitions=repetitions, weight=weight) def calculate_relative_positions(start_dates): diff --git a/db.py b/db.py index ad52bf2..e69e630 100644 --- a/db.py +++ b/db.py @@ -448,9 +448,11 @@ class DataBase(): topset = self.execute(""" SELECT t.repetitions, - t.weight + t.weight, + e.name as "exercise_name" FROM topset t JOIN workout w ON t.workout_id = w.workout_id + JOIN exercise e ON t.exercise_id = e.exercise_id WHERE w.person_id = %s AND t.exercise_id = %s ORDER BY @@ -461,7 +463,7 @@ class DataBase(): if not topset: return None else: - return (topset['repetitions'], topset['weight']) + return (topset['repetitions'], topset['weight'], topset['exercise_name']) def get_all_exercises(self): exercises = self.execute( diff --git a/templates/partials/exercise/exercise_list_item.html b/templates/partials/exercise/exercise_list_item.html index 559f37c..cf76034 100644 --- a/templates/partials/exercise/exercise_list_item.html +++ b/templates/partials/exercise/exercise_list_item.html @@ -1,8 +1,7 @@ -