diff --git a/app/models/cerfa.rb b/app/models/cerfa.rb index 40fdd8cdf..c9ea2786d 100644 --- a/app/models/cerfa.rb +++ b/app/models/cerfa.rb @@ -3,7 +3,7 @@ class Cerfa < ActiveRecord::Base belongs_to :user mount_uploader :content, CerfaUploader - validates :content, :file_size => {:maximum => 3.megabytes} + validates :content, :file_size => {:maximum => 6.megabytes} def empty? content.blank? diff --git a/app/models/piece_justificative.rb b/app/models/piece_justificative.rb index 1208069d2..9408e4899 100644 --- a/app/models/piece_justificative.rb +++ b/app/models/piece_justificative.rb @@ -10,7 +10,7 @@ class PieceJustificative < ActiveRecord::Base alias_attribute :type, :type_de_piece_justificative_id mount_uploader :content, PieceJustificativeUploader - validates :content, :file_size => {:maximum => 3.megabytes} + validates :content, :file_size => {:maximum => 6.megabytes} validates :content, presence: true, allow_blank: false, allow_nil: false def empty? diff --git a/app/views/users/description/_pieces_justificatives.html.haml b/app/views/users/description/_pieces_justificatives.html.haml index f8f076666..e5fb27a14 100644 --- a/app/views/users/description/_pieces_justificatives.html.haml +++ b/app/views/users/description/_pieces_justificatives.html.haml @@ -8,9 +8,9 @@ -if @dossier.cerfa_available? %span.btn.btn-sm.btn-file.btn-success Modifier - %input{type: 'file', name:'cerfa_pdf', id:'cerfa_pdf', accept: PieceJustificative.accept_format, :max_file_size => 3.megabytes } + %input{type: 'file', name:'cerfa_pdf', id:'cerfa_pdf', accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes } -else - %input{type: 'file', name:'cerfa_pdf', id:'cerfa_pdf', accept: PieceJustificative.accept_format, :max_file_size => 3.megabytes } + %input{type: 'file', name:'cerfa_pdf', id:'cerfa_pdf', accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes } - @dossier.types_de_piece_justificative.order('order_place ASC').each do |type_de_piece_justificative| %tr @@ -21,8 +21,8 @@ %span.text-success{ id: "piece_justificative_#{type_de_piece_justificative.id}" } Nous l'avons récupéré pour vous. -else -if @dossier.retrieve_last_piece_justificative_by_type(type_de_piece_justificative.id).nil? - = file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: PieceJustificative.accept_format, :max_file_size => 3.megabytes + = file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes -else %span.btn.btn-sm.btn-file.btn-success Modifier - = file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: PieceJustificative.accept_format, :max_file_size => 3.megabytes + = file_field_tag "piece_justificative_#{type_de_piece_justificative.id}", accept: PieceJustificative.accept_format, :max_file_size => 6.megabytes