Refactor worklog handling and table rendering in templates for improved clarity and performance

This commit is contained in:
Yaro Kasear 2025-06-16 16:24:41 -05:00
parent 25e67cce28
commit bdd2a43c8b
6 changed files with 40 additions and 58 deletions

View file

@ -8,7 +8,7 @@
<h1 class="display-4">Welcome to Inventory Manager</h1>
<p class="lead">Find out about all of your assets.</p>
<div class="row">
{% if stale_pagination['items'] %}
{% if stale_worklog_rows %}
<div class="col">
<div class="card">
<div class="card-body">
@ -16,17 +16,11 @@
<h6 class="card-subtitle mb-2 text-body-secondary">You have {{ stale_count }} worklogs
that need attention!</h6>
{{ tables.render_table(
stale_worklog_headers,
stale_worklog_rows,
'worklog_entry'
)}}
{{ tables.render_pagination(
'index',
stale_pagination['page'],
stale_pagination['has_prev'],
stale_pagination['has_next'],
stale_pagination['total_pages'],
page_variable='stale_worklog_page'
headers = stale_worklog_headers,
rows = stale_worklog_rows,
id = 'Stale Worklog',
entry_route = 'worklog_entry',
per_page = 3
)}}
</div>
</div>