From 4afbf69217bf5b2f69b667322cadd02797a6901d Mon Sep 17 00:00:00 2001 From: Michele Tessaro Date: Tue, 30 Jun 2020 16:10:08 +0200 Subject: [PATCH] Fix, action confirmation disabling (#1408) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix suggested by Kamil BreguĊ‚a. --- .../templates/appbuilder/general/lib.html | 62 ++++++++++--------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/flask_appbuilder/templates/appbuilder/general/lib.html b/flask_appbuilder/templates/appbuilder/general/lib.html index 6d4638966b..c8d5541a96 100644 --- a/flask_appbuilder/templates/appbuilder/general/lib.html +++ b/flask_appbuilder/templates/appbuilder/general/lib.html @@ -1,10 +1,10 @@ {% macro render_additional_links(additional_links, pk) %} - {% if additional_links %} - {% for item in additional_links %} - - {{_(item.label)}} - {% endfor %} - {% endif %} + {% if additional_links %} + {% for item in additional_links %} + + {{_(item.label)}} + {% endfor %} + {% endif %} {% endmacro %} {% macro render_action_links(actions, pk, modelview_name) %} @@ -59,7 +59,7 @@ {{_('Actions')}} - + $('.{{action.name}}_menu_item').on('click', function(){ + {% if action.confirmation %} + return modelActions.execute_multiple('{{action.name}}','{{action.confirmation}}'); + {% else %} + return modelActions.execute_multiple('{{action.name}}', false); + {% endif %} + }) + {% endfor %} + }); + {% endif %} {% endmacro %} @@ -94,7 +98,7 @@ {{_('Page size')}}