An unquoted attribute value ends at the first whitespace, so ``class=badge bg-danger`` is read by every browser as ``class="badge"`` plus two meaningless attributes. Bootstrap was loading perfectly well; the markup simply never asked for the styles. Across the ops portal that meant buttons rendered as plain links, status badges were invisible (white text on a white background: a failed result showed as nothing at all), the active sidebar item never highlighted, and the flex utility classes did nothing. The buyer portal templates quote their attributes, which is why only the ops portal looked unstyled. 346 attributes across 20 templates, rewritten mechanically with a conservative transform that handles the three shapes in use — a Django tag as the value, a multi-token class list, and a trailing simple conditional (the active-nav highlight) — and leaves anything it does not recognise exactly as it was.
67 lines
3.2 KiB
HTML
67 lines
3.2 KiB
HTML
{% extends 'ops/base_ops.html' %}
|
|
{% block title %}EUDR Compliance - IXG Operations{% endblock %}
|
|
{% block content %}
|
|
|
|
<div class="page-header d-flex justify-content-between align-items-center">
|
|
<h2>EUDR Due Diligence Cases</h2>
|
|
<span class="text-secondary">{{ page_obj.paginator.count }} total</span>
|
|
</div>
|
|
|
|
<div class="alert alert-light border py-2 small">
|
|
<i class="bi bi-info-circle"></i> Shea butter is not listed in EUDR Annex I; this tracker provides due-diligence
|
|
evidence and buyer assurance, not an EU-mandated filing.
|
|
</div>
|
|
|
|
<div class="filter-bar">
|
|
<form method="get" class="row g-2 align-items-end">
|
|
<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:eudr_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>Batch</th><th>Status</th><th>Risk Level</th><th>Approved</th><th>Updated</th><th></th></tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for c in cases %}
|
|
<tr>
|
|
<td><strong>{{ c.batch.batch_reference }}</strong></td>
|
|
<td><span class="badge"
|
|
{% if c.status == 'approved' %}bg-success
|
|
{% elif c.status == 'rejected' %}bg-danger
|
|
{% elif c.status == 'complete_for_review' %}bg-primary
|
|
{% elif c.status == 'mitigation_required' or c.status == 'risk_identified' %}bg-warning text-dark
|
|
{% else %}bg-secondary{% endif %}>{{ c.get_status_display }}</span></td>
|
|
<td><span class="badge" {% if c.risk_level == 'high' %}bg-danger{% elif c.risk_level == 'low' %}bg-success{% else %}bg-info text-dark{% endif %}>{{ c.get_risk_level_display }}</span></td>
|
|
<td>{{ c.approved_at|date:'d/m/Y H:i'|default:'-' }}</td>
|
|
<td>{{ c.updated_at|date:'d/m/Y' }}</td>
|
|
<td><a href="{% url 'ops:eudr_detail' c.pk %}" class="btn btn-sm btn-primary">Review</a></td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr><td colspan="6" class="text-muted text-center py-3">No due diligence cases</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 %}
|