From 11ca7472f0736ed7f7cc4447f8fa59cd8765eb2f Mon Sep 17 00:00:00 2001 From: stilbruch Date: Sat, 30 Apr 2022 12:56:15 -0500 Subject: Start workout history page --- app/routes/workout.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'app/routes') diff --git a/app/routes/workout.py b/app/routes/workout.py index 996105c..9b46694 100644 --- a/app/routes/workout.py +++ b/app/routes/workout.py @@ -145,3 +145,19 @@ def workout_record(): @login_required def workout_select(): return render_template("workout/select.html") + + +@app.route("/workout/history", methods=["GET"]) +@login_required +def workout_history(): + if "id" not in request.args: + return redirect(url_for("home")) + + # Matching workout record required + record = WorkoutRecord.query.filter_by( + id=int(request.args["id"]), user_id=current_user.id + ).first() + if not record: + return redirect(url_for("home")) + + return render_template("workout/history.html", record=record) -- cgit v1.2.3