[Fix #1023] If old commentaire.PJ is present, then display it

This commit is contained in:
Mathieu Magnin 2017-12-01 09:57:19 +01:00
parent 61b1bccbca
commit 19a951d103
2 changed files with 14 additions and 13 deletions

View file

@ -3,15 +3,16 @@
= commentaire.header
.content
= sanitize(commentaire.body)
- if commentaire.file.present?
.file
= link_to commentaire.file_url, class: 'link', target: '_blank' do
%span.fa.fa-file
%div
= commentaire.file_identifier
- elsif file = commentaire.piece_justificative
- if file = commentaire.piece_justificative
.file
= link_to file.content_url, class: 'link', target: '_blank' do
%span.fa.fa-file
%div
= file.original_filename
- elsif commentaire.file.present?
.file
= link_to commentaire.file_url, class: 'link', target: '_blank' do
%span.fa.fa-file
%div
= commentaire.file_identifier

View file

@ -9,13 +9,13 @@
%span.date= I18n.l(commentaire.created_at.localtime, format: '%H:%M le %d/%m/%Y')
.rich-text= sanitize(commentaire.body)
- if commentaire.file.present?
.attachment-link
= link_to commentaire.file_url, class: "button", target: "_blank", title: "Télécharger" do
.icon.attachment
= commentaire.file_identifier
- elsif commentaire.piece_justificative
- if commentaire.piece_justificative
.attachment-link
= link_to commentaire.piece_justificative.content_url, class: "button", target: "_blank", title: "Télécharger" do
.icon.attachment
= commentaire.piece_justificative.original_filename
- elsif commentaire.file.present?
.attachment-link
= link_to commentaire.file_url, class: "button", target: "_blank", title: "Télécharger" do
.icon.attachment
= commentaire.file_identifier