53 lines
No EOL
2.3 KiB
HTML
53 lines
No EOL
2.3 KiB
HTML
{% extends 'portal/base_portal.html' %}
|
|
{% block title %}Documents - IXG Buyer Portal{% endblock %}
|
|
{% block content %}
|
|
|
|
<div class="page-header d-flex justify-content-between align-items-center">
|
|
<h2>Documents</h2>
|
|
<span class="text-secondary">{{ page_obj.paginator.count }} total</span>
|
|
</div>
|
|
|
|
<div class="filter-bar">
|
|
<form method="get" class="row g-2 align-items-end">
|
|
<div class="col-auto">
|
|
<select name="doc_type" class="form-select form-select-sm">
|
|
<option value="">All Types</option>
|
|
{% for val, label in doc_type_choices %}
|
|
<option value="{{ val }}" {% if current_doc_type == 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 'portal:document_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>File Name</th><th>Type</th><th>Batch</th><th>Uploaded</th></tr></thead>
|
|
<tbody>
|
|
{% for d in documents %}
|
|
<tr>
|
|
<td><i class="bi bi-file-earmark"></i> {{ d.file_name }}</td>
|
|
<td><span class="badge bg-light text-dark">{{ d.get_doc_type_display }}</span></td>
|
|
<td>{{ d.batch.batch_reference|default:'-' }}</td>
|
|
<td>{{ d.uploaded_at|date:'d/m/Y' }}</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr><td colspan="4" class="text-muted text-center py-3">No documents available</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 %} |