New UI : Use RemoteDownloader class to hide ovh url
This commit is contained in:
parent
7ea7eea952
commit
150ff5e7ca
2 changed files with 9 additions and 1 deletions
|
@ -17,6 +17,14 @@ class Commentaire < ActiveRecord::Base
|
|||
"#{email}, " + I18n.l(created_at.localtime, format: '%d %b %Y %H:%M')
|
||||
end
|
||||
|
||||
def file_url
|
||||
if Features.remote_storage
|
||||
RemoteDownloader.new(file.path).url
|
||||
else
|
||||
file.url
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def notify
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
- if commentaire.file.present?
|
||||
.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
|
||||
= commentaire.file_identifier
|
||||
- elsif commentaire.piece_justificative
|
||||
|
|
Loading…
Reference in a new issue