2019-05-21 14:21:13 +02:00
|
|
|
|
- should_display_link = attachment.virus_scanner.safe? || !attachment.virus_scanner.started?
|
|
|
|
|
- user_can_upload = defined?(user_can_upload) ? user_can_upload : false
|
|
|
|
|
- if should_display_link
|
|
|
|
|
- attachment_check_url = false
|
|
|
|
|
- else
|
|
|
|
|
- attachment_check_url = attachment_url(attachment.id, { signed_id: attachment.blob.signed_id, user_can_upload: user_can_upload })
|
|
|
|
|
|
2019-10-22 10:58:04 +02:00
|
|
|
|
.attachment-link{ 'data-attachment-id': attachment.id, 'data-attachment-check-url': attachment_check_url }
|
2019-05-21 14:21:13 +02:00
|
|
|
|
- if should_display_link
|
|
|
|
|
= link_to url_for(attachment.blob), target: '_blank', rel: 'noopener', title: "Télécharger la pièce jointe" do
|
2019-10-22 12:21:16 +02:00
|
|
|
|
%span.icon.attached
|
2019-05-21 14:21:13 +02:00
|
|
|
|
= attachment.filename.to_s
|
|
|
|
|
- if !attachment.virus_scanner.started?
|
|
|
|
|
(ce fichier n’a pas été analysé par notre antivirus, téléchargez-le avec précaution)
|
|
|
|
|
|
|
|
|
|
- else
|
|
|
|
|
= attachment.filename.to_s
|
|
|
|
|
- if attachment.virus_scanner.pending?
|
|
|
|
|
(analyse antivirus en cours
|
2019-05-22 12:00:05 +02:00
|
|
|
|
= link_to "rafraichir", request.path, data: { 'attachment-refresh': true }
|
2019-05-21 14:21:13 +02:00
|
|
|
|
)
|
|
|
|
|
- elsif attachment.virus_scanner.infected?
|
|
|
|
|
- if user_can_upload
|
|
|
|
|
(virus détecté, merci d’envoyer un autre fichier)
|
|
|
|
|
- else
|
|
|
|
|
(virus détecté, le téléchargement de ce fichier est bloqué)
|