Files
SneakySwole/app/templates/partials/log_form.html
Phillip Tarrant 272563060c feat: auto-populate suggested reps and weight in log form
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).
2026-02-24 15:46:04 -06:00

27 lines
1.4 KiB
HTML

<!-- Inline logging form, included inside each exercise_card.html -->
<form hx-post="/log"
hx-target="#logs-exercise-{{ exercise_id }}"
hx-swap="innerHTML"
style="margin-bottom:0;">
<input type="hidden" name="exercise_id" value="{{ exercise_id }}">
<input type="hidden" name="workout_day_id" value="{{ workout_day_id }}">
<input type="hidden" name="set_number" value="{{ next_set|default(1) }}">
<div style="display:flex; align-items:center; gap:0.5rem; flex-wrap:wrap;">
<small style="white-space:nowrap; opacity:0.7;">Set {{ next_set|default(1) }}</small>
<input type="number" name="reps" placeholder="Reps"
min="0" max="100" required
{% if suggested_reps %}value="{{ suggested_reps }}"{% endif %}
style="width:5rem; margin-bottom:0;">
<input type="text" name="weight" placeholder="Weight (lbs)"
required
{% if suggested_weight %}value="{{ suggested_weight }}"{% endif %}
style="width:8rem; margin-bottom:0;">
<label style="display:flex; align-items:center; gap:0.3rem; margin-bottom:0; white-space:nowrap;">
<input type="checkbox" name="felt_easy" role="switch" style="margin-bottom:0;">
Easy?
</label>
<button type="submit" style="margin-bottom:0; width:auto; white-space:nowrap;">Log Set</button>
</div>
</form>