Add JPG and PNG image on cerfa and piece justificative uploader

This commit is contained in:
Xavier J 2016-06-06 16:38:14 +02:00
parent ddeaf5abf3
commit d26feb4c72
3 changed files with 6 additions and 4 deletions

View file

@ -23,7 +23,7 @@ class PieceJustificative < ActiveRecord::Base
(RemoteDownloader.new content.filename).url
else
(LocalDownloader.new content.path,
(type_de_piece_justificative.nil? ? content.original_filename : type_de_piece_justificative.libelle)).url
(type_de_piece_justificative.nil? ? content.original_filename : type_de_piece_justificative.libelle)).url
end
end
end
@ -38,7 +38,9 @@ class PieceJustificative < ActiveRecord::Base
application/vnd.openxmlformats-officedocument.presentationml.presentation,
application/vnd.oasis.opendocument.text,
application/vnd.oasis.opendocument.presentation,
application/vnd.oasis.opendocument.spreadsheet
application/vnd.oasis.opendocument.spreadsheet,
image/png,
image/jpeg
"
end
end

View file

@ -25,7 +25,7 @@ class CerfaUploader < CarrierWave::Uploader::Base
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list
%w(pdf doc docx xls xlsx ppt pptx odt ods odp)
%w(pdf doc docx xls xlsx ppt pptx odt ods odp jpg jpeg png)
end
def filename

View file

@ -25,7 +25,7 @@ class PieceJustificativeUploader < CarrierWave::Uploader::Base
# Add a white list of extensions which are allowed to be uploaded.
# For images you might use something like this:
def extension_white_list
%w(pdf doc docx xls xlsx ppt pptx odt ods odp)
%w(pdf doc docx xls xlsx ppt pptx odt ods odp jpg jpeg png)
end
def filename