2023-03-14 17:23:17 +01:00
- if dossier.en_instruction? || (dossier.en_construction? && dossier.may_flag_as_pending_correction?)
2023-04-18 12:10:06 +02:00
= render Dropdown::MenuComponent.new(wrapper: :div, wrapper_options: { data: { turbo_force: :server } }, button_options: { class: [button_or_label_class(dossier)]}, role: :region) do |menu|
2023-02-14 17:57:50 +01:00
- menu.with_button_inner_html do
2023-04-13 19:10:09 +02:00
= dossier.en_instruction? ? "Instruire le dossier" : "Demander une correction"
2023-03-14 17:23:17 +01:00
- if dossier.en_instruction?
- menu.with_item do
= link_to('#', onclick: "DS.showMotivation(event, 'accept');", role: 'menuitem') do
%span.icon.accept
.dropdown-description
%h4 Accepter
L’ usager sera informé que son dossier a été accepté
- menu.with_item(class: "hidden inactive form-inside") do
2023-07-06 14:20:16 +02:00
= render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: placeholder, popup_class: 'accept', process_action: 'accepter', title: 'Accepter', confirm: "Confirmez-vous l'acceptation ce dossier ?" }
2023-03-14 17:23:17 +01:00
- menu.with_item do
= link_to('#', onclick: "DS.showMotivation(event, 'without-continuation');", role: 'menuitem') do
%span.icon.without-continuation
.dropdown-description
%h4 Classer sans suite
L’ usager sera informé que son dossier a été classé sans suite
- menu.with_item(class: "hidden inactive form-inside") do
2023-07-06 14:20:16 +02:00
= render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: placeholder, popup_class: 'without-continuation', process_action: 'classer_sans_suite', title: 'Classer sans suite', confirm: 'Confirmez-vous le classement sans suite de ce dossier ?' }
2023-03-14 17:23:17 +01:00
- menu.with_item do
= link_to('#', onclick: "DS.showMotivation(event, 'refuse');", role: 'menuitem') do
%span.icon.refuse
.dropdown-description
%h4 Refuser
L’ usager sera informé que son dossier a été refusé
- menu.with_item(class: "hidden inactive form-inside") do
2023-07-06 14:20:16 +02:00
= render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier, placeholder: placeholder, popup_class: 'refuse', process_action: 'refuser', title: 'Refuser', confirm: 'Confirmez-vous le refus de ce dossier ?' }
2023-03-14 17:23:17 +01:00
- if dossier.may_flag_as_pending_correction?
- menu.with_item do
2023-04-13 19:10:09 +02:00
= link_to('#', onclick: "DS.showMotivation(event, 'pending_correction');", role: 'menuitem') do
2023-03-14 17:23:17 +01:00
%span.fr-icon.fr-icon-error-warning-line.fr-text-default--info{ "aria-hidden": "true" }
.dropdown-description
2023-04-13 19:10:09 +02:00
%h4 Demander une correction
2023-03-14 17:23:17 +01:00
L’ usager sera informé que des modifications sont attendues
- menu.with_item(class: class_names("inactive form-inside": true, hidden: dossier.en_instruction?)) do
= render partial: 'instructeurs/dossiers/instruction_button_motivation', locals: { dossier: dossier,
visible: !dossier.en_instruction?,
2023-04-13 19:10:09 +02:00
form_path: pending_correction_instructeur_dossier_path(dossier.procedure, dossier),
placeholder: 'Expliquez au demandeur quelle(s) correction(s) sont attendues',
popup_class: 'pending_correction',
2023-03-14 17:23:17 +01:00
button_justificatif_label: "Ajouter une pièce jointe (facultatif)",
process_button: dossier.en_construction? ? 'Valider' : 'Valider et repasser en construction',
process_action: nil,
title: 'Marquer en attente de corrections',
confirm: 'Envoyer la demande de corrections ?'}