Add filtering functionality to inventory listing and enhance templates for better data presentation
This commit is contained in:
parent
a7708ce9c5
commit
5df5f86fd2
8 changed files with 64 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
{% macro render_table(headers, rows, entry_route=None, title=None) %}
|
||||
{% if rows %}
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
class="table table-bordered table-sm table-hover table-striped table-light m-0{% if title %} caption-top{% endif %}">
|
||||
|
@ -32,6 +33,9 @@
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="container text-center">No data.</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_pagination(endpoint, page, has_prev, has_next, total_pages, page_variable='page', extra_args={}) %}
|
||||
|
@ -43,6 +47,7 @@
|
|||
{% set _ = next_args.update({page_variable: page + 1}) %}
|
||||
{% set _ = first_args.update({page_variable: 1}) %}
|
||||
{% set _ = last_args.update({page_variable: total_pages}) %}
|
||||
{% if total_pages > 1 %}
|
||||
|
||||
<div class="d-flex justify-content-between pt-3 px-5 align-items-center">
|
||||
<div>
|
||||
|
@ -72,4 +77,5 @@
|
|||
class="btn btn-primary{% if not has_next %} disabled{% endif %}">Last »</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
Loading…
Add table
Add a link
Reference in a new issue