pj_link: add an "attachment" icon to the link

This commit is contained in:
Pierre de La Morinerie 2019-02-18 17:58:48 +01:00
parent d159d72aab
commit 62ef02183c

View file

@ -1,7 +1,13 @@
- pj = champ.piece_justificative_file - pj = champ.piece_justificative_file
- if champ.virus_scan.present?
- if champ.virus_scan.safe? .pj-link
= link_to pj.filename.to_s, url_for(pj), target: '_blank' - if champ.virus_scan.safe? || champ.virus_scan.blank?
= link_to url_for(pj), target: '_blank', title: "Télécharger la pièce jointe" do
%span.icon.attachment
= pj.filename.to_s
- if champ.virus_scan.blank?
(ce fichier n'a pas été analysé par notre antivirus, téléchargez-le avec précaution)
- else - else
= pj.filename.to_s = pj.filename.to_s
- if champ.virus_scan.pending? - if champ.virus_scan.pending?
@ -13,6 +19,3 @@
(virus détecté, merci d'envoyer un autre fichier) (virus détecté, merci d'envoyer un autre fichier)
- else - else
(virus détecté, le téléchargement de ce fichier est bloqué) (virus détecté, le téléchargement de ce fichier est bloqué)
- else
= link_to pj.filename.to_s, url_for(pj), target: '_blank'
(ce fichier n'a pas été analysé par notre antivirus, téléchargez-le avec précaution)