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:
4
app.py
4
app.py
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user