From c9b41b05b26a405bc6bd07eef6c32a47edb5c10e Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Wed, 13 Aug 2025 14:08:57 -0500 Subject: [PATCH] Starting to add new combobox. --- inventory/templates/fragments/_combobox_fragment.html | 4 +++- inventory/templates/settings.html | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/inventory/templates/fragments/_combobox_fragment.html b/inventory/templates/fragments/_combobox_fragment.html index 4b367bc..45cb626 100644 --- a/inventory/templates/fragments/_combobox_fragment.html +++ b/inventory/templates/fragments/_combobox_fragment.html @@ -73,7 +73,9 @@ create_url = none, edit_url = none, delete_url = none, refresh_url = none {% for option in options if options %} {% endfor %} + {% if not options and refresh_url %} + {% endif %} {% if refresh_url %} @@ -83,4 +85,4 @@ create_url = none, edit_url = none, delete_url = none, refresh_url = none {% endif %} -{% endmacro %} \ No newline at end of file +{% endmacro %}} \ No newline at end of file diff --git a/inventory/templates/settings.html b/inventory/templates/settings.html index e62bc51..65cdae6 100644 --- a/inventory/templates/settings.html +++ b/inventory/templates/settings.html @@ -128,11 +128,14 @@
- {{ combos.render_combobox( + {{ combos.dynamic_combobox( id='brand', - options=brands, label='Brands', - placeholder='Add a new brand' + placeholder='Add a new brand', + create_url=url_for('ui.create_item', model_name='brand'), + edit_url=url_for('ui.update_item', model_name='brand'), + refresh_url=url_for('ui.list_items', model_name='brand'), + delete_url=url_for('ui.delete_item', model_name='brand') ) }}