Various bug fixes. Still trying to fix cartesian issue on search.

This commit is contained in:
Yaro Kasear 2025-10-09 09:27:54 -05:00
parent 0dbf246bdb
commit 3c07741500
9 changed files with 412 additions and 94 deletions

View file

@ -8,15 +8,49 @@ Inventory Manager - {{ model|title }} Listing
<div class="container-fluid">
<h1 class="display-4 text-center mt-5">{{ model|title }} Listing</h1>
<div class="btn-group">
<button type="button" class="btn btn-primary mb-3" onclick="location.href='{{ url_for('entry.entry_new', model=model) }}'">New</button>
<button type="button" class="btn btn-primary mb-3"
onclick="location.href='{{ url_for('entry.entry_new', model=model) }}'">New</button>
</div>
</div>
{{ table | safe }}
<div class="d-flex justify-content-evenly mx-5">
<button onclick="location.href='{{ url_for('listing.show_list', model=model, cursor=pagination['prev_cursor']) }}'" class="btn btn-primary" type="buttom">Prev</button>
{{ pagination['total'] }} records
<button onclick="location.href='{{ url_for('listing.show_list', model=model, cursor=pagination['next_cursor']) }}'" class="btn btn-primary" type="buttom">Next</button>
</div>
<nav class="d-flex justify-content-center my-4" 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>
<p class="text-center text-muted small mb-5">
Page {{ pagination.page }} of {{ pagination.pages }} · {{ pagination.total }} records
</p>
{% endblock %}