From e582243cb85b9968ddbee8fa653ff9ebf12d9c50 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sat, 16 Jul 2022 14:40:29 +1000 Subject: [PATCH] Add page/route to display workouts for a selected person --- app.py | 7 +- templates/workouts.html | 172 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+), 1 deletion(-) create mode 100644 templates/workouts.html diff --git a/app.py b/app.py index a150e9d..e6b946d 100644 --- a/app.py +++ b/app.py @@ -22,12 +22,17 @@ def query_db(query, args=(), one=False): @app.route("/") -def hello_world(): +def home_page(): rows = query_db('select * from TopSet') print(rows[0]['TopSetId']) return render_template('index.html', name='peter') +@app.route("/person/") +def display_workouts_for_person(person_id): + return render_template('workouts.html', name='peter') + + @app.teardown_appcontext def close_connection(exception): db = getattr(g, '_database', None) diff --git a/templates/workouts.html b/templates/workouts.html new file mode 100644 index 0000000..813fd4e --- /dev/null +++ b/templates/workouts.html @@ -0,0 +1,172 @@ +{% extends 'base.html' %} + +{% block content %} + +
+ +
+
+

Gabe

+ List of workouts +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Date + + Squats + + Bench + + Deadlift + + Lat Pulldown +
+ Apr 23 ,2021 + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg +
+ Apr 23 ,2021 + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg +
+ Apr 23 ,2021 + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg +
+ Apr 23 ,2021 + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg +
+ Apr 23 ,2021 + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg +
+ Apr 23 ,2021 + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg +
+ Apr 23 ,2021 + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg + + 5 x 60kg +
+
+
+
+
+
+ +{% endblock %} \ No newline at end of file