feat: add Phase 4 Logging & Tracking — inline set logging, history views
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>
This commit is contained in:
39
app/templates/partials/log_entry.html
Normal file
39
app/templates/partials/log_entry.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!-- Displays logged sets for a single exercise within a session -->
|
||||
{% if logs %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Set</th>
|
||||
<th>Reps</th>
|
||||
<th>Weight</th>
|
||||
<th>Easy?</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for log in logs %}
|
||||
<tr>
|
||||
<td>{{ log.set_number }}</td>
|
||||
<td>{{ log.reps_completed }}</td>
|
||||
<td>{{ log.weight_used }}</td>
|
||||
<td>{{ "Yes" if log.felt_easy else "No" }}</td>
|
||||
<td>
|
||||
<form hx-post="/log/{{ log.id }}/delete"
|
||||
hx-target="#logs-exercise-{{ exercise_id }}"
|
||||
hx-swap="innerHTML"
|
||||
hx-confirm="Delete this set?"
|
||||
style="display:inline; margin:0;">
|
||||
<button type="submit" class="outline secondary"
|
||||
style="padding:0.2rem 0.5rem; font-size:0.8rem;">
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
<!-- Next set form -->
|
||||
{% include "partials/log_form.html" %}
|
||||
Reference in New Issue
Block a user