From 5d08424481a8a6ae1b69c96a6ee43394d9aa8963 Mon Sep 17 00:00:00 2001 From: stilbruch Date: Sat, 23 Apr 2022 13:24:57 -0500 Subject: Start workout record page --- app/routes.py | 11 +++++++++- app/templates/workout/record.html | 45 +++++++++++++++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/routes.py b/app/routes.py index 8f5d8c1..76ea96a 100644 --- a/app/routes.py +++ b/app/routes.py @@ -115,7 +115,16 @@ def editWorkout(): @app.route("/workout/record", methods=['GET']) @login_required def recordWorkout(): - return render_template('workout/record.html') + # Id is required + if 'id' not in request.args: + return redirect(url_for('home')) + + # Matching workout required + workout = Workout.query.filter_by(id=int(request.args['id']), user_id=current_user.id).first() + if not workout: + return redirect(url_for('home')); + + return render_template('workout/record.html', workout=workout) @app.route("/workout/select", methods=['GET']) @login_required diff --git a/app/templates/workout/record.html b/app/templates/workout/record.html index bc6b695..6463fe4 100644 --- a/app/templates/workout/record.html +++ b/app/templates/workout/record.html @@ -1,12 +1,49 @@ {% extends 'base/layout.html' %} {% block content %} - -
+
- -
+

Record {{ workout.name }}

+
+ {% for exercise in workout.exercises %} +

{{ exercise.name }}

+
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +

+ + + +

+
+
+ +
+ + +
+ {% endfor %} +
+
-- cgit v1.2.3