From 34cdc17eee2cfefa05542c11534eccecc3953824 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Thu, 17 Jul 2025 13:24:26 -0500 Subject: [PATCH] Refactor worklog export functionality to use dynamic export links and improve code readability --- inventory/templates/inventory.html | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/inventory/templates/inventory.html b/inventory/templates/inventory.html index d7e67f2..73a8301 100644 --- a/inventory/templates/inventory.html +++ b/inventory/templates/inventory.html @@ -88,15 +88,6 @@ } {% endset %} {% set buttonBar %} - {% if worklog %} - - {% endif %}
{{ buttons.render_button( id='save', @@ -264,7 +255,24 @@ ) }}
{% if worklog %} -
+
+
+
+ Work Log Entries + {% set id_list = worklog_rows | map(attribute='id') | list %} + {{ links.export_link( + id = (item.identifier | replace('Name: ', '') + | replace('ID:', '') + | replace('Serial: ', '') + | replace('Barcode: ', '') + | lower) + '_worklog', + endpoint = 'worklog', + ids = {'ids': id_list} + ) }} +
+
+
+
{% for note in notes %} {% set title %} {{ note.timestamp.strftime('%Y-%m-%d %H:%M:%S') }}{{ links.entry_link('worklog_entry', note.work_log_id) }}