feat: Refactor workout functionality into blueprint

- Moved workout-related routes (create/delete/edit workouts, topsets, tags, start dates, show workout) from `app.py` into a new blueprint at `routes/workout.py`.
- Integrated workout view model logic from `features/workout.py` directly into `routes/workout.py` helper function `_get_workout_view_model`.
- Removed `features/workout.py` and the corresponding class instantiation in `db.py`.
- Registered the new `workout_bp` blueprint in `app.py`.
- Removed the original workout route definitions from `app.py`.
- Updated `url_for` calls in relevant templates (`workout.html`, `person_overview.html`, `partials/workout_tags.html`, `partials/topset.html`, `partials/start_date.html`, `partials/new_set_form.html`, `notes.html`, `calendar.html`) to reference the new blueprint endpoints (e.g., `workout.create_workout`).
- Updated `templates/changelog/changelog.html` to document this refactoring.
This commit is contained in:
Peter Stockings
2025-03-31 22:38:48 +11:00
parent 78436b230b
commit eaeb4ab2c8
13 changed files with 276 additions and 242 deletions

View File

@@ -10,6 +10,17 @@
<div class="prose max-w-none">
<p>Updates and changes to the site will be documented here, with the most recent changes listed first.</p>
<!-- New Entry for Workout Refactoring -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">March 31, 2025</h2>
<ul class="list-disc pl-5 space-y-1">
<li>Refactored workout functionality (create/delete/edit workouts, topsets, tags) into its own blueprint
(`routes/workout.py`).</li>
<li>Moved workout view model logic from `features/workout.py` into the `routes/workout.py` blueprint.
</li>
<li>Updated relevant `url_for` calls in templates to use the new `workout.` prefix.</li>
</ul>
<!-- New Entry for Calendar Year View Fix -->
<hr class="my-6">
<h2 class="text-xl font-semibold mb-2">March 31, 2025</h2>