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)
+2 -2
View File
@@ -186,7 +186,7 @@ def add_tag_to_workout(workout_id):
# Render the partial with the complete list of tags (selected and unselected)
return render_template('partials/workout_tags_list.html', tags=all_person_tags, person_id=person_id, workout_id=workout_id)
return render_template('partials/workout_tag_editor.html' if request.args.get('view') == 'session' else 'partials/workout_tags_list.html', tags=all_person_tags, person_id=person_id, workout_id=workout_id)
@tags_bp.route("/workout/<int:workout_id>/new", methods=['POST'])
@login_required
@@ -271,4 +271,4 @@ def create_new_tag_for_workout(workout_id):
# Render the partial with the complete list of tags
# Use 'tags' as the variable name consistent with the other endpoint and likely the partial
return render_template('partials/workout_tags_list.html', tags=all_person_tags, person_id=person_id, workout_id=workout_id)
return render_template('partials/workout_tag_editor.html' if request.args.get('view') == 'session' else 'partials/workout_tags_list.html', tags=all_person_tags, person_id=person_id, workout_id=workout_id)