fix: url helper method calls for files
This commit is contained in:
parent
f78b415c51
commit
3aa6a5e28e
8 changed files with 8 additions and 8 deletions
|
@ -11,7 +11,7 @@
|
||||||
- elsif export.available?
|
- elsif export.available?
|
||||||
- menu.with_item do
|
- menu.with_item do
|
||||||
%div
|
%div
|
||||||
= link_to ready_link_label(export), export.file.service_url, target: "_blank", rel: "noopener", role: 'menuitem'
|
= link_to ready_link_label(export), export.file.url, target: "_blank", rel: "noopener", role: 'menuitem'
|
||||||
- if export.old?
|
- if export.old?
|
||||||
= button_to download_export_path(export_format: export.format, force_export: true), refresh_button_options(export).merge(role: 'menuitem') do
|
= button_to download_export_path(export_format: export.format, force_export: true), refresh_button_options(export).merge(role: 'menuitem') do
|
||||||
.icon.retry
|
.icon.retry
|
||||||
|
|
|
@ -15,7 +15,7 @@ module Administrateurs
|
||||||
end
|
end
|
||||||
|
|
||||||
format.html do
|
format.html do
|
||||||
redirect_to export.file.service_url
|
redirect_to export.file.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -19,7 +19,7 @@ module Instructeurs
|
||||||
|
|
||||||
def attestation
|
def attestation
|
||||||
if dossier.attestation.pdf.attached?
|
if dossier.attestation.pdf.attached?
|
||||||
redirect_to dossier.attestation.pdf.service_url
|
redirect_to dossier.attestation.pdf.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ module Instructeurs
|
||||||
end
|
end
|
||||||
|
|
||||||
format.html do
|
format.html do
|
||||||
redirect_to export.file.service_url
|
redirect_to export.file.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -73,7 +73,7 @@ module Users
|
||||||
|
|
||||||
def attestation
|
def attestation
|
||||||
if dossier.attestation&.pdf&.attached?
|
if dossier.attestation&.pdf&.attached?
|
||||||
redirect_to dossier.attestation.pdf.service_url
|
redirect_to dossier.attestation.pdf.url
|
||||||
else
|
else
|
||||||
flash.notice = t('.no_longer_available')
|
flash.notice = t('.no_longer_available')
|
||||||
redirect_to dossier_path(dossier)
|
redirect_to dossier_path(dossier)
|
||||||
|
|
|
@ -11,7 +11,7 @@ module Types
|
||||||
if object.is_a?(Hash)
|
if object.is_a?(Hash)
|
||||||
object[:url]
|
object[:url]
|
||||||
else
|
else
|
||||||
object.service_url
|
object.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -55,7 +55,7 @@ class Champs::PieceJustificativeChamp < Champ
|
||||||
return nil if attachment.nil?
|
return nil if attachment.nil?
|
||||||
|
|
||||||
if attachment.virus_scanner.safe? || attachment.virus_scanner.pending?
|
if attachment.virus_scanner.safe? || attachment.virus_scanner.pending?
|
||||||
attachment.service_url
|
attachment.url
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -86,7 +86,7 @@ class Export < ApplicationRecord
|
||||||
|
|
||||||
def flash_message
|
def flash_message
|
||||||
if available?
|
if available?
|
||||||
"L’export au format \"#{format}\" est prêt. Vous pouvez le <a href=\"#{file.service_url}\">télécharger</a>"
|
"L’export au format \"#{format}\" est prêt. Vous pouvez le <a href=\"#{file.url}\">télécharger</a>"
|
||||||
else
|
else
|
||||||
"Nous générons cet export. Veuillez revenir dans quelques minutes pour le télécharger."
|
"Nous générons cet export. Veuillez revenir dans quelques minutes pour le télécharger."
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue