Integrate session note and tag editing and center progress controls

This commit is contained in:
Peter Stockings
2026-09-06 22:38:11 +10:00
parent d5e3e1d930
commit dc0f41cd27
12 changed files with 156 additions and 110 deletions
+3 -3
View File
@@ -84,7 +84,7 @@ def get_person_notes(person_id):
def get_workout_note_edit_form(person_id, workout_id):
"""Returns the form to edit a specific workout note."""
note = _fetch_workout_note(person_id, workout_id) # Use local helper
return render_template('partials/workout_note.html', person_id=person_id, workout_id=workout_id, note=note, is_edit=True)
return render_template('partials/session_note.html' if request.args.get('view') == 'session' else 'partials/workout_note.html', person_id=person_id, workout_id=workout_id, note=note, is_edit=True)
@notes_bp.route("/person/<int:person_id>/workout/<int:workout_id>/note", methods=['PUT'])
@validate_workout
@@ -93,11 +93,11 @@ def update_workout_note(person_id, workout_id):
note = request.form.get('note')
_update_workout_note_for_person(person_id, workout_id, note) # Use local helper
db.activityRequest.log(current_user.id, 'UPDATE_NOTE', 'workout', workout_id, f"Updated note for workout {workout_id}")
return render_template('partials/workout_note.html', person_id=person_id, workout_id=workout_id, note=note)
return render_template('partials/session_note.html' if request.args.get('view') == 'session' else 'partials/workout_note.html', person_id=person_id, workout_id=workout_id, note=note)
@notes_bp.route("/person/<int:person_id>/workout/<int:workout_id>/note", methods=['GET'])
@validate_workout
def get_workout_note(person_id, workout_id):
"""Returns the display partial for a specific workout note."""
note = _fetch_workout_note(person_id, workout_id) # Use local helper
return render_template('partials/workout_note.html', person_id=person_id, workout_id=workout_id, note=note)
return render_template('partials/session_note.html' if request.args.get('view') == 'session' else 'partials/workout_note.html', person_id=person_id, workout_id=workout_id, note=note)