Add context to delete button

This commit is contained in:
Corinne Durrmeyer 2024-10-21 15:31:51 +02:00
parent c10bec342a
commit 95acc0adb6
No known key found for this signature in database
GPG key ID: DDC049DDA35585B6

View file

@ -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:)