New UI : Use RemoteDownloader class to hide ovh url

This commit is contained in:
Mathieu Magnin 2017-11-07 17:15:05 +01:00
parent 7ea7eea952
commit 150ff5e7ca
2 changed files with 9 additions and 1 deletions

View file

@ -17,6 +17,14 @@ class Commentaire < ActiveRecord::Base
"#{email}, " + I18n.l(created_at.localtime, format: '%d %b %Y %H:%M') "#{email}, " + I18n.l(created_at.localtime, format: '%d %b %Y %H:%M')
end end
def file_url
if Features.remote_storage
RemoteDownloader.new(file.path).url
else
file.url
end
end
private private
def notify def notify

View file

@ -19,7 +19,7 @@
- if commentaire.file.present? - if commentaire.file.present?
.attachment-link .attachment-link
= link_to commentaire.file.url, class: "button", target: "_blank", title: "Télécharger" do = link_to commentaire.file_url, class: "button", target: "_blank", title: "Télécharger" do
.icon.attachment .icon.attachment
= commentaire.file_identifier = commentaire.file_identifier
- elsif commentaire.piece_justificative - elsif commentaire.piece_justificative