summaryrefslogtreecommitdiff
path: root/app/routes
diff options
context:
space:
mode:
authorstilbruch <stilbruch@protonmail.com>2022-04-30 12:56:15 -0500
committerstilbruch <stilbruch@protonmail.com>2022-04-30 12:56:15 -0500
commit11ca7472f0736ed7f7cc4447f8fa59cd8765eb2f (patch)
tree0d8a360753d97077171d087fac131b5e50c6906b /app/routes
parent509a7bd8955138b2ff864dd75059d397b3fbb31e (diff)
downloadStrengthy-11ca7472f0736ed7f7cc4447f8fa59cd8765eb2f.tar.xz
Strengthy-11ca7472f0736ed7f7cc4447f8fa59cd8765eb2f.zip
Start workout history page
Diffstat (limited to 'app/routes')
-rw-r--r--app/routes/workout.py16
1 files changed, 16 insertions, 0 deletions
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)