diff --git a/app/views/form/support_letters/_support_letter.html.slim b/app/views/form/support_letters/_support_letter.html.slim index 16fb89cef..9c2300da5 100644 --- a/app/views/form/support_letters/_support_letter.html.slim +++ b/app/views/form/support_letters/_support_letter.html.slim @@ -31,4 +31,7 @@ li.view-only mount_name: :attachment span.clear - = button_to "Remove", form_form_answer_support_letter_path(@form_answer, support_letter), method: :delete, class: "govuk-button govuk-button--warning #{'read_only' if admin_in_read_only_mode?}", 'aria-label' => "Delete support letter from #{support_letter.first_name} #{support_letter.last_name}" + = button_to "Remove", form_form_answer_support_letter_path(@form_answer, support_letter), + data: { method: :delete, confirm: 'Are you sure you want to delete this letter of support?' }, + class: "govuk-button govuk-button--warning #{'read_only' if admin_in_read_only_mode?}", + 'aria-label' => "Delete support letter from #{support_letter.first_name} #{support_letter.last_name}" diff --git a/app/views/qae_form/_supporter_fields.html.slim b/app/views/qae_form/_supporter_fields.html.slim index 531f51bd6..b02a8fe58 100644 --- a/app/views/qae_form/_supporter_fields.html.slim +++ b/app/views/qae_form/_supporter_fields.html.slim @@ -50,6 +50,6 @@ li.js-add-example class="#{'read-only js-support-letter-received' if persisted}" - else - url = "#" - if current_user || policy(:support_letter).can_remove? - = link_to "Remove", url, class: "govuk-button govuk-button--warning remove-supporter remove-link js-remove-link", data: { url: url }, 'aria-label' => "Delete support letter from #{supporter["first_name"]} #{supporter["last_name"]}" + = link_to "Remove", url, class: "govuk-button govuk-button--warning remove-supporter remove-link js-remove-link", data: { confirm: 'Are you sure you want to delete this letter of support?', url: url }, 'aria-label' => "Delete support letter from #{supporter["first_name"]} #{supporter["last_name"]}" - else - = link_to "Remove", "#", class: "govuk-button govuk-button--warning remove-supporter remove-link js-remove-link govuk-!-display-none", data: { url: "#" }, 'aria-label' => "#" + = link_to "Remove", "#", class: "govuk-button govuk-button--warning remove-supporter remove-link js-remove-link govuk-!-display-none", data: { confirm: 'Are you sure you want to delete this letter of support?', url: "#" }, 'aria-label' => "#" diff --git a/app/views/qae_form/_supporter_fields_placeholder.html.slim b/app/views/qae_form/_supporter_fields_placeholder.html.slim index b95578a8b..a48b38559 100644 --- a/app/views/qae_form/_supporter_fields_placeholder.html.slim +++ b/app/views/qae_form/_supporter_fields_placeholder.html.slim @@ -32,4 +32,4 @@ li.js-add-example class="govuk-!-display-none" button.govuk-button.button-alt.js-save-collection data-save-collection-url=users_form_answer_support_letters_url(@form_answer) disabled='disabled' | Submit letter of support - = link_to "Remove", "#", class: "govuk-button govuk-button--warning remove-supporter remove-link js-remove-link govuk-!-display-none", data: { url: "#" }, 'aria-label' => "#" + = link_to "Remove", "#", class: "govuk-button govuk-button--warning remove-supporter remove-link js-remove-link govuk-!-display-none", data: { confirm: 'Are you sure you want to delete this letter of support?', url: "#" }, 'aria-label' => "#"