ixg_platform/templates/ops/specification_list.html
ixgadmin d74f0814da Finish the wiki root move, zone map view and spec approval
- Follow home/user-guides/ through one GUIDE_PATH_PREFIX constant.
- Add a read-only Origin Zone detail view with the map as the main panel.
- Name due diligence explicitly and add its section headings.
- Add admin-only, four-eyes specification approval (portal and API).
- Empty the New-zone geometry placeholder instead of showing null.
2026-10-27 17:41:08 +00:00

110 lines
4.5 KiB
HTML

{% extends 'ops/base_ops.html' %}
{% block title %}Specifications - IXG Operations{% endblock %}
{% block content %}
{% if messages %}
{% for m in messages %}<div class="alert alert-{{ m.tags }} py-2">{{ m }}</div>{% endfor %}
{% endif %}
<div class="page-header d-flex justify-content-between align-items-center">
<h2>Product Specifications</h2>
<div>
<span class="text-secondary me-2">{{ page_obj.paginator.count }} total</span>
<a href="{% url 'ops:specification_create' %}" class="btn btn-sm btn-primary"><i class="bi bi-plus-lg"></i> New specification</a>
</div>
</div>
<div class="alert alert-light border py-2 small">
A specification is the set of limits every QC result is judged against. The portal can
create and edit one; <strong>approval is a separate administrator action</strong>, and
nobody may approve a specification they created (four-eyes). A new specification is
saved as a draft until an administrator approves it.
</div>
<div class="filter-bar">
<form method="get" class="row g-2 align-items-end">
<div class="col-auto">
<input type="text" name="product" class="form-control form-control-sm" placeholder="Search product..." value="{{ current_product }}">
</div>
<div class="col-auto">
<select name="status" class="form-select form-select-sm">
<option value="">All Statuses</option>
{% for val, label in status_choices %}
<option value="{{ val }}" {% if current_status == val %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
</div>
<div class="col-auto">
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
<a href="{% url 'ops:specification_list' %}" class="btn btn-sm btn-outline-secondary">Clear</a>
</div>
</form>
</div>
<div class="stat-card p-0">
<table class="table table-hover mb-0">
<thead>
<tr>
<th>Product</th>
<th>Version</th>
<th>Status</th>
<th>Current</th>
<th>Effective from</th>
<th>Effective to</th>
<th>Parameters</th>
<th></th>
</tr>
</thead>
<tbody>
{% for s in specs %}
<tr>
<td><strong>{{ s.product }}</strong></td>
<td>{{ s.version }}</td>
<td>
{% if s.status == 'approved' %}
<span class="badge bg-success">{{ s.get_status_display }}</span>
{% elif s.status == 'superseded' %}
<span class="badge bg-warning text-dark">{{ s.get_status_display }}</span>
{% else %}
<span class="badge bg-secondary">{{ s.get_status_display }}</span>
{% endif %}
</td>
<td>{% if s.is_current %}<i class="bi bi-check-circle-fill text-success"></i>{% else %}-{% endif %}</td>
<td>{{ s.effective_from|date:'d/m/Y'|default:'-' }}</td>
<td>{{ s.effective_to|date:'d/m/Y'|default:'-' }}</td>
<td>{{ s.parameters.all|length }}</td>
<td>
<a href="{% url 'ops:specification_update' s.pk %}" class="btn btn-sm btn-outline-primary">Edit</a>
{% if show_approval and s.status == 'draft' and not s.approval_error %}
<form method="post" action="{% url 'ops:specification_approve' s.pk %}" class="d-inline"
onsubmit="return confirm('Approve {{ s.product|escapejs }} v{{ s.version|escapejs }} and make it the current specification? This changes the limits QC is judged against.');">
{% csrf_token %}
<button type="submit" class="btn btn-sm btn-success"><i class="bi bi-check-circle"></i> Approve</button>
</form>
{% endif %}
</td>
</tr>
{% empty %}
<tr><td colspan="8" class="text-muted text-center py-3">No specifications yet</td></tr>
{% endfor %}
</tbody>
</table>
</div>
{% if page_obj.paginator.num_pages > 1 %}
<nav class="mt-3">
<ul class="pagination pagination-sm justify-content-center">
{% if page_obj.has_previous %}
<li class="page-item"><a class="page-link" href="?page=1">&laquo;</a></li>
<li class="page-item"><a class="page-link" href="?page={{ page_obj.previous_page_number }}">{{ page_obj.previous_page_number }}</a></li>
{% endif %}
<li class="page-item active"><span class="page-link">{{ page_obj.number }}</span></li>
{% if page_obj.has_next %}
<li class="page-item"><a class="page-link" href="?page={{ page_obj.next_page_number }}">{{ page_obj.next_page_number }}</a></li>
<li class="page-item"><a class="page-link" href="?page={{ page_obj.paginator.num_pages }}">&raquo;</a></li>
{% endif %}
</ul>
</nav>
{% endif %}
{% endblock %}