100 lines
3.8 KiB
HTML
100 lines
3.8 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="container mt-4">
|
|
<h2>Review Calibration</h2>
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Calibration Details</h5>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<p><strong>Channel Serial:</strong> {{ calibration.channels.serial_number }}</p>
|
|
<p><strong>Date:</strong> {{ calibration.date }}</p>
|
|
<p><strong>Calibrated By:</strong> {{ calibration.calibrated_by.name }}</p>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<p><strong>Scale:</strong> {{ calibration.scale }}</p>
|
|
<p><strong>Offset:</strong> {{ calibration.offset }}</p>
|
|
<p><strong>Status:</strong>
|
|
<span class="badge bg-{{ 'success' if calibration.passed else 'danger' }}">
|
|
{{ 'Passed' if calibration.passed else 'Failed' }}
|
|
</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card mb-4">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Measurements</h5>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Point</th>
|
|
<th>Set Value</th>
|
|
<th>Deviation</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>High</td>
|
|
<td>{{ calibration.set_high }}</td>
|
|
<td>{{ calibration.deviation_high }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Mid</td>
|
|
<td>{{ calibration.set_mid }}</td>
|
|
<td>{{ calibration.deviation_mid }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Low</td>
|
|
<td>{{ calibration.set_low }}</td>
|
|
<td>{{ calibration.deviation_low }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<form method="POST" action="{{ url_for('calibrations.review_calibration', calibration_id=calibration.id) }}">
|
|
<input type="hidden" name="reviewer_id" value="{{ current_user.id }}">
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label">Electronic Signature</label>
|
|
<div id="signaturePad" style="border: 1px solid #ddd; height: 200px;"></div>
|
|
<input type="hidden" name="signature" id="signatureData">
|
|
<button type="button" class="btn btn-secondary mt-2" id="clearSignature">Clear</button>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary">Submit Review</button>
|
|
</form>
|
|
</div>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/signature_pad@4.0.0/dist/signature_pad.umd.min.js"></script>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const canvas = document.createElement('canvas');
|
|
canvas.width = document.getElementById('signaturePad').offsetWidth;
|
|
canvas.height = 200;
|
|
document.getElementById('signaturePad').appendChild(canvas);
|
|
|
|
const signaturePad = new SignaturePad(canvas);
|
|
|
|
document.getElementById('clearSignature').addEventListener('click', function() {
|
|
signaturePad.clear();
|
|
});
|
|
|
|
document.querySelector('form').addEventListener('submit', function(e) {
|
|
if (signaturePad.isEmpty()) {
|
|
e.preventDefault();
|
|
alert('Please provide your signature');
|
|
} else {
|
|
document.getElementById('signatureData').value = signaturePad.toDataURL();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|