From 56ceb878674a140c25ed734266cdec64fd0adc2e Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Wed, 23 Nov 2022 22:48:03 +1100 Subject: [PATCH] Fix for filter not working after selecting a single exercise --- templates/dashboard.html | 2 +- templates/partials/page/person.html | 190 ++++++++++++++-------------- 2 files changed, 95 insertions(+), 97 deletions(-) diff --git a/templates/dashboard.html b/templates/dashboard.html index 9c9e5a1..6890643 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -3,6 +3,6 @@ {% block content %} {{ render_partial('partials/page/dashboard.html', -people=people, exercises=exercises) }} +model=model) }} {% endblock %} \ No newline at end of file diff --git a/templates/partials/page/person.html b/templates/partials/page/person.html index fc9b2ca..e8a44ad 100644 --- a/templates/partials/page/person.html +++ b/templates/partials/page/person.html @@ -1,116 +1,114 @@ -
-
-
+
+
-
-
-

{{ person['PersonName'] }}

- List of workouts -
-
-
- -
-
+
+
+

{{ person['PersonName'] }}

+ List of workouts
- -
- {% set exercise_list = person['FilteredExercises'] if is_filtered else person['Exercises'] %} - - {% for e in person['Exercises'] %} -
- - -
- {% endfor %} +
+
+ +
+
-
-
-
-
+
+ {% set exercise_list = person['FilteredExercises'] if is_filtered else person['Exercises'] %} - {% if person['Workouts']|length > 0 %} - - - - - {% for e in exercise_list %} - - {% endfor %} - - - - + {% for e in person['Exercises'] %} +
+ + +
+ {% endfor %} + - {% for w in person['Workouts'] %} - - +
+
+
+
- {% for e in exercise_list %} -
- {% endfor %} + {% if person['Workouts']|length > 0 %} +
- Date - - {{ e['ExerciseName'] }} - -
- {{ w['StartDate'] }} - - {% set topset_exercise = - get_first_element_from_list_with_matching_attribute(w['TopSets'], - 'ExerciseId', - e['ExerciseId']) %} - {% if topset_exercise %} - {{ topset_exercise['Repetitions'] }} x {{ topset_exercise['Weight'] }}kg - {% endif %} -
+ + + + {% for e in exercise_list %} + + {% endfor %} + + + + - + - - - - - + {% for e in exercise_list %} + {% endfor %} - -
+ Date + + {{ e['ExerciseName'] }} + +
- - Edit - + {% for w in person['Workouts'] %} +
+ {{ w['StartDate'] }} +
+ {% set topset_exercise = + get_first_element_from_list_with_matching_attribute(w['TopSets'], + 'ExerciseId', + e['ExerciseId']) %} + {% if topset_exercise %} + {{ topset_exercise['Repetitions'] }} x {{ topset_exercise['Weight'] }}kg + {% endif %} +
- {% endif %} + + + Edit + - {% if person['Workouts']|length == 0 %} - - {% endif %} +
+ +
+ + + {% endfor %} + + + {% endif %} + + {% if person['Workouts']|length == 0 %} + + {% endif %} +
+
- {{ render_partial('partials/stats.html', stats=person['Stats']) }} -
\ No newline at end of file +{{ render_partial('partials/stats.html', stats=person['Stats']) }} \ No newline at end of file