demarches-normaliennes/app/components/attachment/multiple_component/multiple_component.html.haml
Colin Darie 4824363879 refactor(attachment): rename user_can_download -> explicit view_as
- link: shows a simple link to open attachment
- download: shows complete DSFR download UI
2022-12-08 20:36:15 +01:00

13 lines
787 B
Text

.fr-mb-4w.attachment-multiple{ class: class_names("fr-downloads-group": view_as == :download, "destroyable": user_can_destroy?) }
= template
%ul
- each_attachment do |attachment, index|
%li{ id: dom_id(attachment) }
= render Attachment::EditComponent.new(champ:, attached_file:, attachment:, index:, as_multiple: true, view_as:, user_can_destroy:, form_object_name:)
%div{ id: empty_component_id, class: class_names("hidden": !can_attach_next?) }
= render Attachment::EditComponent.new(champ:, attached_file:, attachment: nil, index: attachments_count, user_can_destroy:, form_object_name:)
// single poll and refresh message for all attachments
= render Attachment::PendingPollComponent.new(attachments: attachments, poll_url:, context: poll_context)