Add run tagging (DB column + migration + route + UI)
- Added tags VARCHAR(300) column to Run model - Added startup ALTER TABLE migration in app.py - New POST /run/<id>/set_tags route saves comma-separated tags - Tag badges + collapsible edit form in run_details.html header area Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -394,6 +394,22 @@ def revise_book(run_id, book_folder):
|
||||
return redirect(url_for('run.view_run', id=new_run.id))
|
||||
|
||||
|
||||
@run_bp.route('/run/<int:id>/set_tags', methods=['POST'])
|
||||
@login_required
|
||||
def set_tags(id):
|
||||
run = db.session.get(Run, id)
|
||||
if not run: return "Run not found", 404
|
||||
if run.project.user_id != current_user.id: return "Unauthorized", 403
|
||||
|
||||
raw = request.form.get('tags', '')
|
||||
tags = [t.strip() for t in raw.split(',') if t.strip()]
|
||||
run.tags = ','.join(dict.fromkeys(tags))
|
||||
db.session.commit()
|
||||
|
||||
flash("Tags updated.")
|
||||
return redirect(url_for('run.view_run', id=id))
|
||||
|
||||
|
||||
@run_bp.route('/run/<int:id>/delete', methods=['POST'])
|
||||
@login_required
|
||||
def delete_run(id):
|
||||
|
||||
Reference in New Issue
Block a user