Some layout tweaks.
This commit is contained in:
parent
3c07741500
commit
9181ba660f
5 changed files with 80 additions and 65 deletions
|
|
@ -5,52 +5,47 @@ Inventory Manager - {{ model|title }} Listing
|
|||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<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>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
{{ table | safe }}
|
||||
|
||||
<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">
|
||||
<p class="text-center text-muted small mb-2">
|
||||
Page {{ pagination.page }} of {{ pagination.pages }} · {{ pagination.total }} records
|
||||
</p>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue