On hover of exercise progress sparkline on new workout modal, show estimated 1rm and date of workout as a popover
This commit is contained in:
4
app.py
4
app.py
@@ -434,7 +434,7 @@ def calculate_relative_positions(start_dates):
|
||||
def get_exercise_progress_for_user(person_id, exercise_id):
|
||||
width = request.args.get('width', 300, type=int)
|
||||
height = request.args.get('height', 100, type=int)
|
||||
(estimated_1rm, start_dates) = db.get_exercise_progress_for_user(person_id, exercise_id)
|
||||
(estimated_1rm, start_dates, messages) = db.get_exercise_progress_for_user(person_id, exercise_id)
|
||||
|
||||
# Calculate vb_width
|
||||
min_date = min(start_dates)
|
||||
@@ -460,7 +460,7 @@ def get_exercise_progress_for_user(person_id, exercise_id):
|
||||
estimated_1rm = [((value - min_value) / value_range) * vb_height for value in estimated_1rm]
|
||||
|
||||
relative_positions = calculate_relative_positions(start_dates)
|
||||
data_points = list(zip(estimated_1rm, relative_positions))
|
||||
data_points = list(zip(estimated_1rm, relative_positions, messages))
|
||||
|
||||
return render_template('partials/sparkline.html', title="GHR", vb_width=vb_width, vb_height=vb_height, data_points=data_points)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user