From c3e4f2c6fe88fcacf85b6979a1c675e6037f6d67 Mon Sep 17 00:00:00 2001 From: George Drummond Date: Mon, 6 May 2019 14:33:06 -0400 Subject: [PATCH] Move to component --- templates/components/delete_confirmation.html | 25 +++++++++++++++ .../applications/edit_environments.html | 32 ++++++------------- 2 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 templates/components/delete_confirmation.html diff --git a/templates/components/delete_confirmation.html b/templates/components/delete_confirmation.html new file mode 100644 index 00000000..e5e9bfc5 --- /dev/null +++ b/templates/components/delete_confirmation.html @@ -0,0 +1,25 @@ +{% macro DeleteConfirmation(modal_id, delete_text, delete_action, form) %} + +
+
+ + +
+
+
+ {{ form.csrf_token }} + +
+ +
+
+
+{% endmacro %} diff --git a/templates/fragments/applications/edit_environments.html b/templates/fragments/applications/edit_environments.html index 348d6e37..b2c5349b 100644 --- a/templates/fragments/applications/edit_environments.html +++ b/templates/fragments/applications/edit_environments.html @@ -3,6 +3,7 @@ {% from "components/text_input.html" import TextInput %} {% from "components/save_button.html" import SaveButton %} {% from "components/modal.html" import Modal %} +{% from "components/delete_confirmation.html" import DeleteConfirmation %} {% macro RolePanel(users=[], role='no_access') %} {% if role == 'no_access' %} @@ -136,29 +137,14 @@ ) }} - -
-
- - -
-
-
- {{ form.csrf_token }} - -
- -
-
-
+ {{ + DeleteConfirmation( + modal_id=delete_modal_environment_id, + delete_text=('portfolios.applications.delete.button' | translate), + delete_action= url_for('applications.delete_environment', environment_id=env['id']), + form=form + ) + }} {% endcall %} {% endfor %}