feat: add Phase 3 Workout UI — auth, profiles, workout viewer, exercise browser

Build the core user-facing experience with admin login (bcrypt + signed
session cookies), profile switcher, workout day viewer with warmups and
exercise cards, and HTMX-powered exercise browser with search/filter.

- AuthService with bcrypt password verification and itsdangerous session tokens
- Auth dependency redirects to /login (303) for unauthenticated requests
- NavContextMiddleware injects admin/profiles/active_profile into all templates
- Profile management (list, switch, edit) with cookie-based active profile
- Workout day viewer shows warmups + exercises + per-user programming targets
- Exercise browser with HTMX filter dropdowns (no page reloads)
- Flash message partial for success/error feedback
- 12 new tests (66 total passing)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 11:14:52 -06:00
parent 1f47103480
commit 23754ea239
29 changed files with 1267 additions and 11 deletions

View File

@@ -0,0 +1,38 @@
{% extends "base.html" %}
{% block title %}Exercise Library — SneakySwole{% endblock %}
{% block content %}
<hgroup>
<h1>Exercise Library</h1>
<p>Browse all exercises with form cues and programming details.</p>
</hgroup>
<!-- HTMX-powered filters -->
<div class="grid">
<select name="workout_day"
hx-get="/exercises/search"
hx-target="#exercise-results"
hx-include="[name='muscle_group']">
<option value="">All Days</option>
{% for day in workout_days %}
<option value="{{ day.name }}">{{ day.name }}</option>
{% endfor %}
</select>
<select name="muscle_group"
hx-get="/exercises/search"
hx-target="#exercise-results"
hx-include="[name='workout_day']">
<option value="">All Muscle Groups</option>
{% for mg in muscle_groups %}
<option value="{{ mg }}">{{ mg }}</option>
{% endfor %}
</select>
</div>
<!-- Exercise results (replaced by HTMX on filter change) -->
<div id="exercise-results">
{% include "partials/exercise_list.html" %}
</div>
{% endblock %}