From 95acc0adb6182eac6ae7f3d44e8e02f0fcb34b07 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Mon, 21 Oct 2024 15:31:51 +0200 Subject: [PATCH] Add context to delete button --- .../attachment/edit_component/edit_component.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/attachment/edit_component/edit_component.html.haml b/app/components/attachment/edit_component/edit_component.html.haml index 45d8ceafc..423490e50 100644 --- a/app/components/attachment/edit_component/edit_component.html.haml +++ b/app/components/attachment/edit_component/edit_component.html.haml @@ -6,7 +6,7 @@ .flex.flex-gap-2{ class: class_names("attachment-error": attachment.virus_scanner_error?) } - if user_can_destroy? = render NestedForms::OwnedButtonComponent.new(formaction: destroy_attachment_path, http_method: :delete, opt: {class: "fr-btn fr-btn--tertiary fr-btn--sm fr-icon-delete-line", title: t(".delete_file", filename: attachment.filename)}) do - = t('.delete') + = t('.delete_file', filename: attachment.filename) - if downloadable?(attachment) = render Dsfr::DownloadComponent.new(attachment: attachment) @@ -24,7 +24,7 @@ .flex.flex-gap-2{ class: class_names("attachment-error": attachment.virus_scanner_error?) } - if user_can_destroy? = render NestedForms::OwnedButtonComponent.new(formaction: destroy_attachment_path, http_method: :delete, opt: {class: "fr-btn fr-btn--tertiary fr-btn--sm fr-icon-delete-line", title: t(".delete_file", filename: attachment.filename)}) do - = t('.delete') + = t('.delete_file', filename: attachment.filename) - if downloadable?(attachment) = render Dsfr::DownloadComponent.new(attachment:)