Reorganize workout view for desktop and compact session details

This commit is contained in:
Peter Stockings
2026-09-06 17:10:06 +10:00
parent 1aa5d7418b
commit d5e3e1d930
9 changed files with 345 additions and 183 deletions
+14
View File
@@ -0,0 +1,14 @@
{% set totals = namespace(reps=0) %}
{% for top_set in top_sets %}{% set totals.reps = totals.reps + (top_set.repetitions or 0)|int %}{% endfor %}
<section class="workout-card workout-summary" id="workout-summary"
aria-label="Session summary" aria-live="polite"
hx-get="{{ url_for('workout.get_workout_summary', person_id=person_id, workout_id=workout_id) }}"
hx-trigger="topsetAdded from:body, topsetChanged from:body" hx-swap="outerHTML">
<p class="workout-eyebrow">This session</p>
<dl>
<div><dt>Exercises</dt><dd>{{ top_sets|map(attribute='exercise_id')|unique|list|length }}</dd></div>
<div><dt>Top sets</dt><dd>{{ top_sets|length }}</dd></div>
<div><dt>Reps</dt><dd>{{ totals.reps }}</dd></div>
</dl>
<p class="workout-subtle">Based on your logged top sets.</p>
</section>