51 lines
No EOL
1.7 KiB
HTML
51 lines
No EOL
1.7 KiB
HTML
{% extends 'base.html' %}
|
|
|
|
{% block title %}
|
|
Inventory Manager - {{ model|title }} Listing
|
|
{% endblock %}
|
|
|
|
{% block main %}
|
|
<div class="mx-5">
|
|
<h1 class="display-4 text-center mt-2">{{ 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>
|
|
</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 %} |