From 0356f6c8170521058186b38b3c03c47d6129df11 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sat, 16 Jul 2022 15:50:06 +1000 Subject: [PATCH] Add page/route to create new workout for person --- app.py | 9 ++- templates/add_workout.html | 56 ------------- templates/base.html | 9 +-- templates/index.html | 6 +- templates/new_workout.html | 158 +++++++++++++++++++++++++++++++++++++ templates/workouts.html | 11 +++ 6 files changed, 184 insertions(+), 65 deletions(-) delete mode 100644 templates/add_workout.html create mode 100644 templates/new_workout.html diff --git a/app.py b/app.py index e6b946d..75df870 100644 --- a/app.py +++ b/app.py @@ -22,7 +22,7 @@ def query_db(query, args=(), one=False): @app.route("/") -def home_page(): +def dashboard(): rows = query_db('select * from TopSet') print(rows[0]['TopSetId']) return render_template('index.html', name='peter') @@ -30,7 +30,12 @@ def home_page(): @app.route("/person/") def display_workouts_for_person(person_id): - return render_template('workouts.html', name='peter') + return render_template('workouts.html', person_id=person_id) + + +@app.route("/person//new_workout") +def new_workout_for_person(person_id): + return render_template('new_workout.html', name='peter') @app.teardown_appcontext diff --git a/templates/add_workout.html b/templates/add_workout.html deleted file mode 100644 index cc9c18d..0000000 --- a/templates/add_workout.html +++ /dev/null @@ -1,56 +0,0 @@ -{% extends 'base.html' %} - -{% block content %} - -
-
-
- -
-
- -
- -
- - - -
-
-
- -
- - -
- -
- - -
-
- -
-
-
- -{% endblock %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index da46d3d..876d9c7 100644 --- a/templates/base.html +++ b/templates/base.html @@ -6,7 +6,7 @@ Workout Tracker - + @@ -59,7 +59,7 @@