Update probe related models, routes and templates
This commit is contained in:
@@ -162,9 +162,14 @@ def review_calibration(calibration_id):
|
||||
flash('Calibration not found', 'error')
|
||||
return redirect(url_for('calibrations.index'))
|
||||
|
||||
user = {
|
||||
'user_name': session.get('user_name'),
|
||||
'can_calibrate': session.get('can_calibrate'),
|
||||
'can_review': session.get('can_review')
|
||||
}
|
||||
return render_template('calibration_review.html',
|
||||
calibration=calibration.data[0],
|
||||
user=session)
|
||||
user=user)
|
||||
|
||||
@calibrations_bp.route('/new')
|
||||
def new_calibration():
|
||||
@@ -189,13 +194,18 @@ def new_calibration():
|
||||
# Get all parameters (using correct column name)
|
||||
parameters = supabase.table('parameters').select('id, parameter_name').execute()
|
||||
|
||||
user = {
|
||||
'user_name': session.get('user_name'),
|
||||
'can_calibrate': session.get('can_calibrate'),
|
||||
'can_review': session.get('can_review')
|
||||
}
|
||||
return render_template('calibration_form.html',
|
||||
work_orders=work_orders.data,
|
||||
standards=standards.data,
|
||||
channels=channels.data,
|
||||
probe_models=probe_models.data,
|
||||
parameters=parameters.data,
|
||||
user=session)
|
||||
user=user)
|
||||
|
||||
@calibrations_bp.route('/filtered-channels')
|
||||
def get_filtered_channels():
|
||||
@@ -248,6 +258,11 @@ def index():
|
||||
calibrated_by:calibrated_by(name)
|
||||
''').order('date', desc=True).limit(10).execute()
|
||||
|
||||
user = {
|
||||
'user_name': session.get('user_name'),
|
||||
'can_calibrate': session.get('can_calibrate'),
|
||||
'can_review': session.get('can_review')
|
||||
}
|
||||
return render_template('calibration_dashboard.html',
|
||||
summary={
|
||||
'total_calibrations': total,
|
||||
@@ -255,7 +270,7 @@ def index():
|
||||
'failed_calibrations': failed
|
||||
},
|
||||
recent_calibrations=recent_calibrations.data,
|
||||
user=session)
|
||||
user=user)
|
||||
|
||||
@calibrations_bp.route('/probe/<probe_id>')
|
||||
def calibrations_for_probe(probe_id):
|
||||
@@ -278,10 +293,15 @@ def calibrations_for_probe(probe_id):
|
||||
# Get probe details
|
||||
probe = supabase.table('probes').select('*').eq('id', probe_id).execute()
|
||||
|
||||
user = {
|
||||
'user_name': session.get('user_name'),
|
||||
'can_calibrate': session.get('can_calibrate'),
|
||||
'can_review': session.get('can_review')
|
||||
}
|
||||
return render_template('calibration_history.html',
|
||||
calibrations=calibrations.data,
|
||||
probe=probe.data[0] if probe.data else None,
|
||||
user=session)
|
||||
user=user)
|
||||
|
||||
@calibrations_bp.route('/probe/<probe_id>/trends')
|
||||
def calibration_trends(probe_id):
|
||||
@@ -344,6 +364,11 @@ def view_calibration(calibration_id):
|
||||
flash('Calibration not found', 'error')
|
||||
return redirect(url_for('calibrations.index'))
|
||||
|
||||
user = {
|
||||
'user_name': session.get('user_name'),
|
||||
'can_calibrate': session.get('can_calibrate'),
|
||||
'can_review': session.get('can_review')
|
||||
}
|
||||
return render_template('calibration_view.html',
|
||||
calibration=calibration.data[0],
|
||||
user=session)
|
||||
user=user)
|
||||
|
||||
Reference in New Issue
Block a user