diff --git a/app.py b/app.py index be6e1e7..ba7275e 100644 --- a/app.py +++ b/app.py @@ -255,8 +255,8 @@ def render_users_and_workouts(): users_data.append(user_data) if htmx: - render_template('users_and_workouts_wrapper.html', - users=users_data, bikes=Bike.query.all()) + return render_template('users_and_workouts_wrapper.html', + users=users_data, bikes=Bike.query.all()) return render_template('users_and_workouts.html', users=users_data, bikes=Bike.query.all()) diff --git a/templates/users.html b/templates/users.html index b0ade3c..627f5d8 100644 --- a/templates/users.html +++ b/templates/users.html @@ -1,7 +1,7 @@
-
+
+ type="submit" onclick="location.href = '{{ url_for('new_workout', user_id=u.id) }}';">New Workout
-
+
+ {% if u.workouts_count > 0 %} +

- - - - \ No newline at end of file + {% endif %} +
\ No newline at end of file