diff --git a/app/components/editable_champ/piece_justificative_component/piece_justificative_component.html.haml b/app/components/editable_champ/piece_justificative_component/piece_justificative_component.html.haml index f9b2b2cb9..c459f7012 100644 --- a/app/components/editable_champ/piece_justificative_component/piece_justificative_component.html.haml +++ b/app/components/editable_champ/piece_justificative_component/piece_justificative_component.html.haml @@ -1,5 +1,6 @@ - user_can_destroy = !@champ.mandatory? || @champ.dossier.brouillon? -= render Attachment::MultipleComponent.new(form: @form, attached_file: @champ.piece_justificative_file, user_can_destroy: user_can_destroy, max: @champ.procedure&.piece_justificative_multiple == false ? 1 : nil) do |c| +- max = [true, nil].include?(@champ.procedure&.piece_justificative_multiple?) ? 10 : 1 += render Attachment::MultipleComponent.new(form: @form, attached_file: @champ.piece_justificative_file, user_can_destroy:, max:) do |c| - if @champ.type_de_champ.piece_justificative_template&.attached? - c.with_template do %p diff --git a/app/controllers/administrateurs/procedures_controller.rb b/app/controllers/administrateurs/procedures_controller.rb index aedb59a05..fe4108141 100644 --- a/app/controllers/administrateurs/procedures_controller.rb +++ b/app/controllers/administrateurs/procedures_controller.rb @@ -397,7 +397,7 @@ module Administrateurs :tags ] - editable_params << :piece_justificative_multiple if @procedure&.piece_justificative_multiple == false + editable_params << :piece_justificative_multiple if @procedure && !@procedure.piece_justificative_multiple? permited_params = if @procedure&.locked? params.require(:procedure).permit(*editable_params)