From 9ab743e43d2854498349ab5c6312c92298845fd0 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Fri, 2 Jan 2026 22:39:23 +0100 Subject: [PATCH] fix: update vendor templates to use new modal_simple macro API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The modal_simple macro was simplified to use {% call %}...{% endcall %} syntax with content passed as the caller block. Updated 5 vendor templates: - products.html (2 modals: delete, bulk delete) - orders.html (2 modals: status update, bulk status update) - inventory.html (3 modals: adjust, set quantity, bulk adjust) - order-detail.html (2 modals: status update, ship all) - team.html (2 modals: edit member, remove member) The new pattern provides more flexibility by allowing custom content including buttons to be placed inside the modal body. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- app/templates/vendor/inventory.html | 151 ++++++++++++++----------- app/templates/vendor/order-detail.html | 98 ++++++++-------- app/templates/vendor/orders.html | 84 +++++++------- app/templates/vendor/products.html | 66 ++++++----- app/templates/vendor/team.html | 102 +++++++++-------- 5 files changed, 272 insertions(+), 229 deletions(-) diff --git a/app/templates/vendor/inventory.html b/app/templates/vendor/inventory.html index f7928862..5690bee7 100644 --- a/app/templates/vendor/inventory.html +++ b/app/templates/vendor/inventory.html @@ -253,84 +253,85 @@ {{ pagination(show_condition="!loading && pagination.total > 0") }} -{{ modal_simple( - show_var='showAdjustModal', - title='Adjust Stock', - icon='plus-minus', - icon_color='blue', - confirm_text='Adjust', - confirm_class='bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple', - confirm_fn='executeAdjust()', - loading_var='saving' -) }} - + +{% endcall %} -{{ modal_simple( - show_var='showSetModal', - title='Set Quantity', - icon='pencil', - icon_color='purple', - confirm_text='Set', - confirm_class='bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple', - confirm_fn='executeSet()', - loading_var='saving' -) }} - + +{% endcall %} -{{ modal_simple( - show_var='showBulkAdjustModal', - title='Bulk Adjust Stock', - icon='plus-minus', - icon_color='blue', - confirm_text='Adjust All', - confirm_class='bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple', - confirm_fn='bulkAdjust()', - loading_var='saving' -) }} - +
+ + +
+ +{% endcall %} {% endblock %} {% block extra_scripts %} diff --git a/app/templates/vendor/order-detail.html b/app/templates/vendor/order-detail.html index 96196c88..622c6dfe 100644 --- a/app/templates/vendor/order-detail.html +++ b/app/templates/vendor/order-detail.html @@ -354,18 +354,9 @@ -{{ modal_simple( - show_var='showStatusModal', - title='Update Order Status', - icon='pencil-square', - icon_color='blue', - confirm_text='Update', - confirm_class='bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple', - confirm_fn='confirmStatusUpdate()', - loading_var='saving' -) }} - - +
+ + +
+ +{% endcall %} -{{ modal_simple( - show_var='showShipAllModal', - title='Ship All Items', - icon='truck', - icon_color='indigo', - confirm_text='Ship All', - confirm_class='bg-indigo-600 hover:bg-indigo-700 focus:shadow-outline-indigo', - confirm_fn='shipAllItems()', - loading_var='saving' -) }} - +
+ + +
+
+ + +
+ +{% endcall %} {% endblock %} {% block extra_scripts %} diff --git a/app/templates/vendor/orders.html b/app/templates/vendor/orders.html index 210c7a22..ae412e7c 100644 --- a/app/templates/vendor/orders.html +++ b/app/templates/vendor/orders.html @@ -265,46 +265,42 @@ {{ pagination(show_condition="!loading && pagination.total > 0") }} -{{ modal_simple( - show_var='showStatusModal', - title='Update Order Status', - icon='pencil-square', - icon_color='blue', - confirm_text='Update', - confirm_class='bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple', - confirm_fn='updateStatus()', - loading_var='saving' -) }} - + +{% endcall %} -{{ modal_simple( - show_var='showBulkStatusModal', - title='Bulk Update Status', - icon='pencil-square', - icon_color='blue', - confirm_text='Update All', - confirm_class='bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple', - confirm_fn='bulkUpdateStatus()', - loading_var='saving' -) }} - - +
+ + +
+ +{% endcall %} {% endblock %} {% block extra_scripts %} diff --git a/app/templates/vendor/products.html b/app/templates/vendor/products.html index a2e427a0..116e85a6 100644 --- a/app/templates/vendor/products.html +++ b/app/templates/vendor/products.html @@ -319,40 +319,48 @@ {{ pagination(show_condition="!loading && pagination.total > 0") }} -{{ modal_simple( - show_var='showDeleteModal', - title='Delete Product', - icon='exclamation-triangle', - icon_color='red', - confirm_text='Delete', - confirm_class='bg-red-600 hover:bg-red-700 focus:shadow-outline-red', - confirm_fn='deleteProduct()', - loading_var='saving' -) }} - +{% call modal_simple('deleteProductModal', 'Delete Product', show_var='showDeleteModal', size='sm') %} +
+ +
+ + +
+
+{% endcall %} -{{ modal_simple( - show_var='showBulkDeleteModal', - title='Delete Selected Products', - icon='exclamation-triangle', - icon_color='red', - confirm_text='Delete All', - confirm_class='bg-red-600 hover:bg-red-700 focus:shadow-outline-red', - confirm_fn='bulkDelete()', - loading_var='saving' -) }} - +
+ + +
+ +{% endcall %} {% endblock %} {% block extra_scripts %} diff --git a/app/templates/vendor/team.html b/app/templates/vendor/team.html index fc29f7be..362fdc87 100644 --- a/app/templates/vendor/team.html +++ b/app/templates/vendor/team.html @@ -222,56 +222,66 @@ -{{ modal_simple( - show_var='showEditModal', - title='Edit Team Member', - icon='pencil', - icon_color='blue', - confirm_text='Save', - confirm_class='bg-purple-600 hover:bg-purple-700 focus:shadow-outline-purple', - confirm_fn='updateMember()', - loading_var='saving' -) }} - + +{% endcall %} -{{ modal_simple( - show_var='showRemoveModal', - title='Remove Team Member', - icon='exclamation-triangle', - icon_color='red', - confirm_text='Remove', - confirm_class='bg-red-600 hover:bg-red-700 focus:shadow-outline-red', - confirm_fn='removeMember()', - loading_var='saving' -) }} - +{% call modal_simple('removeTeamMemberModal', 'Remove Team Member', show_var='showRemoveModal', size='sm') %} +
+ +
+ + +
+
+{% endcall %} {% endblock %} {% block extra_scripts %}