From dc13b05420d49dc047d97475538646e6b86eec8c Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Fri, 20 Oct 2023 20:04:07 +1100 Subject: [PATCH] Rename some templates and convert remaining js to hyperscript --- app.py | 2 +- templates/{users_and_workouts.html => overview.html} | 9 ++------- templates/users.html | 8 ++++---- ...outs_wrapper.html => users_and_workouts_list.html} | 0 templates/workout_view.html | 11 +++++------ templates/workouts_list.html | 10 +++++----- 6 files changed, 17 insertions(+), 23 deletions(-) rename templates/{users_and_workouts.html => overview.html} (87%) rename templates/{users_and_workouts_wrapper.html => users_and_workouts_list.html} (100%) diff --git a/app.py b/app.py index 66757fd..8f4d99b 100644 --- a/app.py +++ b/app.py @@ -330,7 +330,7 @@ def render_users_and_workouts(): users_data = [generate_user_data(user, get_workouts_for_user_view_data( user)) for user in users] - template_name = 'users_and_workouts_wrapper.html' if htmx else 'users_and_workouts.html' + template_name = 'users_and_workouts_list.html' if htmx else 'overview.html' return render_template(template_name, users=users_data, bikes=Bike.query.all()) diff --git a/templates/users_and_workouts.html b/templates/overview.html similarity index 87% rename from templates/users_and_workouts.html rename to templates/overview.html index a301c1e..9b62977 100644 --- a/templates/users_and_workouts.html +++ b/templates/overview.html @@ -37,7 +37,7 @@
+ class="w-9 h-9 mr-2"> @@ -57,13 +57,8 @@
-
- {% with users=users, bikes=bikes %} - {% include 'users_and_workouts_wrapper.html' %} - {% endwith %} - - + {{ render_partial('users_and_workouts_list.html', users=users, bikes=bikes) }}
diff --git a/templates/users.html b/templates/users.html index 627f5d8..feedc98 100644 --- a/templates/users.html +++ b/templates/users.html @@ -17,14 +17,14 @@
- +
diff --git a/templates/users_and_workouts_wrapper.html b/templates/users_and_workouts_list.html similarity index 100% rename from templates/users_and_workouts_wrapper.html rename to templates/users_and_workouts_list.html diff --git a/templates/workout_view.html b/templates/workout_view.html index aefc26a..1744bd2 100644 --- a/templates/workout_view.html +++ b/templates/workout_view.html @@ -1,8 +1,10 @@
- @@ -12,9 +14,6 @@
- {% for graph_type in graph_types %} - +