Adding pagination
This commit is contained in:
1 parent
a50fccd56d
commit
e923250177
8 files changed
+269
-46
No files matched your search
@@ -1,4 +1,5 @@
|
||||
<div id="augmented-parts-table-card" class="card">
|
||||
{% include "admin/_pagination.html" %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<div id="imported-parts-table-card" class="card" style="overflow-x:auto">
|
||||
<p class="muted" style="margin-bottom:.5rem">
|
||||
Showing {{ parts|length }} record{{ '' if parts|length == 1 else 's' }}{% if total and total > parts|length %} of {{ total }} total{% endif %}.
|
||||
</p>
|
||||
{% include "admin/_pagination.html" %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
{% if pagination %}
|
||||
<div class="pagination">
|
||||
<span class="muted pagination-info">
|
||||
{% if pagination.total == 0 %}
|
||||
No records found.
|
||||
{% elif pagination.total_pages == 1 %}
|
||||
Showing {{ pagination.total }} record{{ '' if pagination.total == 1 else 's' }}.
|
||||
{% else %}
|
||||
Showing {{ pagination.showing_from }}–{{ pagination.showing_to }} of {{ pagination.total }}.
|
||||
{% endif %}
|
||||
</span>
|
||||
{% if pagination.total_pages > 1 %}
|
||||
<div class="pagination-nav">
|
||||
{% if pagination.prev_url %}
|
||||
<button class="btn btn-ghost btn-sm"
|
||||
hx-get="{{ pagination.prev_url }}"
|
||||
hx-target="{{ pagination.target_id }}"
|
||||
hx-swap="outerHTML">← Prev</button>
|
||||
{% else %}
|
||||
<button class="btn btn-ghost btn-sm" disabled>← Prev</button>
|
||||
{% endif %}
|
||||
<span class="muted">{{ pagination.page }} / {{ pagination.total_pages }}</span>
|
||||
{% if pagination.next_url %}
|
||||
<button class="btn btn-ghost btn-sm"
|
||||
hx-get="{{ pagination.next_url }}"
|
||||
hx-target="{{ pagination.target_id }}"
|
||||
hx-swap="outerHTML">Next →</button>
|
||||
{% else %}
|
||||
<button class="btn btn-ghost btn-sm" disabled>Next →</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -1,4 +1,5 @@
|
||||
<div id="skipped-parts-table-card" class="card" style="overflow-x:auto">
|
||||
{% include "admin/_pagination.html" %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
Reference in new issue
Block a user