demarches-normaliennes/app/components/attachment/edit_component/edit_component.html.haml

41 lines
1.5 KiB
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.fr-mb-2w.attachment.fr-upload-group{ id: attachment ? dom_id(attachment, :edit) : nil }
- if persisted?
%div{ id: dom_id(attachment, :persisted_row) }
.flex.flex-gap-2{ class: class_names("attachment-error": attachment.virus_scanner_error?) }
- if user_can_destroy?
= link_to('Supprimer', destroy_attachment_path, **remove_button_options, class: "fr-btn fr-btn--tertiary fr-btn--sm fr-icon-delete-line", title: "Supprimer le fichier #{attachment.filename}")
.fr-py-1v
- if downloadable?
= render Dsfr::DownloadComponent.new(attachment:)
- else
%span.attachment-filename.fr-mr-1w-= attachment.filename.to_s
= render Attachment::ProgressComponent.new(attachment: attachment)
- if error?
%p.fr-error-text= error_message
- elsif first?
%p.fr-text--sm.fr-text-mention--grey.fr-mb-1w
- if max_file_size.present?
= t('.max_file_size', max_file_size: number_to_human_size(max_file_size))
- if allowed_formats
Formats supportés :
= allowed_formats.join(', ')
- if !as_multiple?
= file_field(champ, field_name, **file_field_options)
- if in_progress?
%div{ data: poll_controller_options }
- if attachment.created_at < 30.seconds.ago
.fr-mt-2w
= render partial: "attachments/pending_refresh", url: attachment_path
.attachment-error.hidden
%p.fr-error-text Une erreur sest produite pendant lenvoi du fichier.
= button_tag(**retry_button_options) do
Ré-essayer