Pre-fill the reps and weight inputs with progression engine suggestions so users can log sets without manually retyping values each time. Suggestions flow through the template chain on initial page load and on all HTMX partial responses (log, edit, delete).
52 lines
1.6 KiB
HTML
52 lines
1.6 KiB
HTML
<article>
|
|
<header>
|
|
<hgroup>
|
|
<h3>{{ exercise.name }}</h3>
|
|
<p>{{ exercise.muscle_group }} | {{ exercise.sets }} sets | Tempo: {{ exercise.tempo }}</p>
|
|
</hgroup>
|
|
</header>
|
|
|
|
{% if program %}
|
|
<div class="grid">
|
|
<div>
|
|
<small>Week 1</small>
|
|
<p>{{ program.wk1_reps }} reps @ {{ program.wk1_weight }}</p>
|
|
</div>
|
|
<div>
|
|
<small>Week 4</small>
|
|
<p>{{ program.wk4_reps }} reps @ {{ program.wk4_weight }}</p>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if suggestions and suggestions[exercise.id] %}
|
|
{% set suggestion = suggestions[exercise.id] %}
|
|
{% include "partials/progression_badge.html" %}
|
|
{% endif %}
|
|
|
|
<details>
|
|
<summary>Form Cues</summary>
|
|
<p>{{ exercise.form_cues }}</p>
|
|
</details>
|
|
|
|
<!-- Inline logging (Phase 4) -->
|
|
{% if active_profile %}
|
|
<div id="logs-exercise-{{ exercise.id }}">
|
|
{% if suggestions and suggestions[exercise.id] %}
|
|
{% set suggested_reps = suggestions[exercise.id].suggested_reps %}
|
|
{% set suggested_weight = suggestions[exercise.id].suggested_weight %}
|
|
{% endif %}
|
|
{% if existing_logs and existing_logs[exercise.id] %}
|
|
{% set logs = existing_logs[exercise.id] %}
|
|
{% set exercise_id = exercise.id %}
|
|
{% set next_set = logs|length + 1 %}
|
|
{% include "partials/log_entry.html" %}
|
|
{% else %}
|
|
{% set exercise_id = exercise.id %}
|
|
{% set next_set = 1 %}
|
|
{% include "partials/log_form.html" %}
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</article>
|