Integrate session note and tag editing and center progress controls
This commit is contained in:
+3
-3
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user