91 lines
3.9 KiB
HTML
91 lines
3.9 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<div class="container mt-4">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<h2 class="mb-0">Work Order: {{ work_order.order_number }}</h2>
|
|
<span class="badge
|
|
{% if work_order.status == 'completed' %}bg-success
|
|
{% elif work_order.status == 'in_progress' %}bg-warning
|
|
{% else %}bg-secondary{% endif %}">
|
|
{{ work_order.status|title }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row mb-3">
|
|
<div class="col-md-6">
|
|
<h5>Details</h5>
|
|
<dl class="row">
|
|
<dt class="col-sm-4">Due Date</dt>
|
|
<dd class="col-sm-8">
|
|
{% if work_order.due_date and work_order.due_date is not string %}
|
|
{{ work_order.due_date.strftime('%Y-%m-%d') }}
|
|
{% else %}
|
|
{{ work_order.due_date or '' }}
|
|
{% endif %}
|
|
</dd>
|
|
|
|
<dt class="col-sm-4">Redmine ID</dt>
|
|
<dd class="col-sm-8">{{ work_order.redmine or 'Not specified' }}</dd>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
|
|
{% if work_order.calibrations %}
|
|
<div class="mt-4">
|
|
<h5>Associated Calibrations</h5>
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>Channel</th>
|
|
<th>Date</th>
|
|
<th>Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for cal in work_order.calibrations %}
|
|
<tr>
|
|
<td>{{ cal.channel.serial_number }}</td>
|
|
<td>{{ cal.date.strftime('%Y-%m-%d') }}</td>
|
|
<td>
|
|
{% if cal.passed %}
|
|
<span class="badge bg-success">Passed</span>
|
|
{% else %}
|
|
<span class="badge bg-danger">Failed</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="mt-4">
|
|
<form method="POST" action="{{ url_for('work_orders.update_status', work_order_id=work_order.id) }}">
|
|
<div class="mb-3">
|
|
<label for="status" class="form-label">Update Status</label>
|
|
<select class="form-select" id="status" name="status">
|
|
<option value="pending" {% if work_order.status == 'pending' %}selected{% endif %}>Pending</option>
|
|
<option value="in_progress" {% if work_order.status == 'in_progress' %}selected{% endif %}>In Progress</option>
|
|
<option value="completed" {% if work_order.status == 'completed' %}selected{% endif %}>Completed</option>
|
|
</select>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Update</button>
|
|
<a href="{{ url_for('work_orders.list_work_orders') }}"
|
|
class="btn btn-outline-secondary">Back to List</a>
|
|
{% if work_order.status == 'completed' %}
|
|
<a href="#" class="btn btn-success ms-2" id="download-certificate">
|
|
Download Certificate
|
|
</a>
|
|
{% endif %}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|