inventory/inventory/templates/listing.html
2025-10-21 09:14:05 -05:00

54 lines
No EOL
1.8 KiB
HTML

{% extends 'base.html' %}
{% block title %}
Inventory Manager - {{ model|title }} Listing
{% endblock %}
{% block main %}
<div class="mx-5">
<div class="d-flex justify-content-between">
<div class="btn-group h-50 align-self-end">
<button type="button" class="btn btn-primary mb-2"
onclick="location.href='{{ url_for('entry.entry_new', model=model) }}'">New</button>
</div>
<h1 class="display-6 text-center">{{ model|title }} Listing</h1>
<div></div>
</div>
{{ table | safe }}
<nav class="d-flex justify-content-center my-2" aria-label="Pagination">
<ul class="pagination mb-0">
{# Prev #}
<li class="page-item {% if not pagination.has_prev %}disabled{% endif %}">
<a class="page-link" href="{{ pagination.prev_url if pagination.has_prev else '#' }}"
aria-label="Previous">Previous</a>
</li>
{# Numbered pages with ellipses #}
{% for item in pagination.nav %}
{% if item.type == 'page' %}
<li class="page-item {% if item.active %}active{% endif %}">
<a class="page-link" href="{{ item.url }}" {% if item.active %}aria-current="page" {% endif %}>{{ item.n }}</a>
</li>
{% elif item.type == 'ellipsis' %}
<li class="page-item disabled">
<a class="page-link" tabindex="-1" aria-disabled="true"></a>
</li>
{% endif %}
{% endfor %}
{# Next #}
<li class="page-item {% if not pagination.has_next %}disabled{% endif %}">
<a class="page-link" href="{{ pagination.next_url if pagination.has_next else '#' }}" aria-label="Next">Next</a>
</li>
</ul>
</nav>
</div>
<p class="text-center text-muted small mb-2">
Page {{ pagination.page }} of {{ pagination.pages }} · {{ pagination.total }} records
</p>
{% endblock %}