Add workout logging so users can track sets, reps, weight, and a
"felt easy?" toggle inline from the workout day view via HTMX.
Sessions auto-create on first log. History page shows past sessions
with detailed per-exercise breakdowns.
New services: WorkoutSessionService, LogService
New routes: POST /log, /log/{id}/edit, /log/{id}/delete, GET /history, /history/{id}
New templates: log_form, log_entry, session_card, log_history, session_detail
Modified: exercise_card (inline logging), nav (History link), workouts route (session context)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
1.2 KiB
HTML
25 lines
1.2 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
|
|
style="width:5rem; margin-bottom:0;">
|
|
<input type="text" name="weight" placeholder="Weight (lbs)"
|
|
required
|
|
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>
|