Merge pull request #1024 from sgmap/fix_1023

[Fix #1023] If old commentaire.PJ is present, then display it
This commit is contained in:
Mathieu Magnin 2017-12-01 10:33:59 +01:00 committed by GitHub
commit f279341737
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View file

@ -3,15 +3,16 @@
= commentaire.header = commentaire.header
.content .content
= sanitize(commentaire.body) = sanitize(commentaire.body)
- if commentaire.file.present?
.file - if file = commentaire.piece_justificative
= link_to commentaire.file_url, class: 'link', target: '_blank' do
%span.fa.fa-file
%div
= commentaire.file_identifier
- elsif file = commentaire.piece_justificative
.file .file
= link_to file.content_url, class: 'link', target: '_blank' do = link_to file.content_url, class: 'link', target: '_blank' do
%span.fa.fa-file %span.fa.fa-file
%div %div
= file.original_filename = 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') %span.date= I18n.l(commentaire.created_at.localtime, format: '%H:%M le %d/%m/%Y')
.rich-text= sanitize(commentaire.body) .rich-text= sanitize(commentaire.body)
- if commentaire.file.present? - if commentaire.piece_justificative
.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
.attachment-link .attachment-link
= link_to commentaire.piece_justificative.content_url, class: "button", target: "_blank", title: "Télécharger" do = link_to commentaire.piece_justificative.content_url, class: "button", target: "_blank", title: "Télécharger" do
.icon.attachment .icon.attachment
= commentaire.piece_justificative.original_filename = 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