Facility, origin zone and collector group could only be registered in the Django admin, which left the portal unable to onboard a new supply site, zone or group. Add list/create/edit screens for all three, and create/edit for mitigation actions, EUDR evidence and external-submission references on a due-diligence case. The origin-zone form keeps the map a view of the stored geometry, not a check of it: the map wording is unchanged and geometry is only required to be valid JSON. Verification is stamped from the acting user when the status moves to verified/rejected, and cleared when it returns to unverified. Nothing is removed from the admin; it stays as the superuser fallback. Adds an nginx /tiles/ route on the ops host so the map imagery loads there too (the tile view is root-mounted but ops remaps / to /ops/).
81 lines
3.1 KiB
HTML
81 lines
3.1 KiB
HTML
{% extends 'ops/base_ops.html' %}
|
|
{% block title %}Facilities - 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>Facilities</h2>
|
|
<div>
|
|
<span class="text-secondary me-2">{{ page_obj.paginator.count }} total</span>
|
|
<a href="{% url 'ops:facility_create' %}" class="btn btn-sm btn-primary"><i class="bi bi-plus-lg"></i> New facility</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="filter-bar">
|
|
<form method="get" class="row g-2 align-items-end">
|
|
<div class="col-auto">
|
|
<input type="text" name="q" class="form-control form-control-sm" placeholder="Search name..." value="{{ current_q }}">
|
|
</div>
|
|
<div class="col-auto">
|
|
<select name="active" class="form-select form-select-sm">
|
|
<option value="">All</option>
|
|
<option value="1" {% if current_active == '1' %}selected{% endif %}>Active</option>
|
|
<option value="0" {% if current_active == '0' %}selected{% endif %}>Retired</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-auto">
|
|
<button type="submit" class="btn btn-sm btn-primary">Filter</button>
|
|
<a href="{% url 'ops:facility_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>Name</th>
|
|
<th>Country</th>
|
|
<th>Region</th>
|
|
<th>Type</th>
|
|
<th>Status</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for f in facilities %}
|
|
<tr>
|
|
<td><strong>{{ f.name }}</strong></td>
|
|
<td>{{ f.country }}</td>
|
|
<td>{{ f.region|default:'-' }}</td>
|
|
<td>{{ f.get_facility_type_display }}</td>
|
|
<td>{% if f.is_active %}<span class="badge bg-success">Active</span>{% else %}<span class="badge bg-secondary">Retired</span>{% endif %}</td>
|
|
<td><a href="{% url 'ops:facility_update' f.pk %}" class="btn btn-sm btn-outline-primary">Edit</a></td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr><td colspan="6" class="text-muted text-center py-3">No facilities registered 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">«</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 }}">»</a></li>
|
|
{% endif %}
|
|
</ul>
|
|
</nav>
|
|
{% endif %}
|
|
|
|
{% endblock %}
|