Improve on the template, most things work???

This commit is contained in:
Charles Descamps 2025-06-03 21:13:39 -07:00
parent c0f9876184
commit 46fa0d1ae5
19 changed files with 396 additions and 181 deletions

24
app/routes/technician.py Normal file
View file

@ -0,0 +1,24 @@
from flask import Blueprint, render_template, request, redirect, url_for, flash
from app.models import Repair, Technician
from app.forms import RepairNoteForm
technician_bp = Blueprint('technician', __name__)
@technician_bp.route('/technician/dashboard')
def dashboard():
repairs = Repair.query.filter_by(status='in_progress').all()
return render_template('technician/dashboard.html', repairs=repairs)
@technician_bp.route('/technician/repair/<int:repair_id>', methods=['GET', 'POST'])
def repair_detail(repair_id):
repair = Repair.query.get_or_404(repair_id)
form = RepairNoteForm()
if form.validate_on_submit():
repair.notes = form.notes.data
repair.status = 'completed'
# Add logic to save the repair status and notes
flash('Repair notes updated successfully!', 'success')
return redirect(url_for('technician.dashboard'))
return render_template('technician/repair_detail.html', repair=repair, form=form)