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

@ -124,18 +124,7 @@ submit_button=True) }}
</div>
{% if worklog %}
<div class="col-6">
{{ tables.render_table(worklog_headers, worklog_rows, 'worklog_entry', 'Work Log') }}
{% if worklog_pagination['total_pages'] > 1 %}
{{ tables.render_pagination(
page=worklog_pagination['page'],
has_prev=worklog_pagination['has_prev'],
has_next=worklog_pagination['has_next'],
total_pages=worklog_pagination['total_pages'],
endpoint='main.inventory_item',
page_variable='worklog_page',
extra_args={'id': item.id, 'worklog_page': worklog_page, 'filter_by': filter_by, 'id': id}
) }}
{% endif %}
{{ tables.render_table(headers=worklog_headers, rows=worklog_rows, id='worklog', entry_route='worklog_entry', title='Work Log') }}
</div>
{% endif %}
</div>