Change user overview graph form so it updates on newly added Add button click, which now adds images in a list. Clicking on generated graph images in list removes them from dom

This commit is contained in:
Peter Stockings
2023-10-21 22:15:41 +11:00
parent a111292dbc
commit 32643a0ba8
2 changed files with 34 additions and 24 deletions

4
app.py
View File

@@ -219,7 +219,7 @@ def graph_user_workouts(user_id):
if htmx:
return f"""
<img src="{request.full_path}"
loading="lazy" alt="No image" class="mx-auto">
loading="lazy" alt="No image" class="mx-auto" _="on click remove me">
"""
user = User.query.get(user_id)
workouts = user.workouts
@@ -236,6 +236,8 @@ def graph_user_workouts(user_id):
attributes = request.args.getlist(
'attributes', type=str)
if not attributes:
return ""
period = request.args.get('period', default='day', type=str)