2023-04-18 18:06:24 +02:00
|
|
|
|
.motivation{ class: class_names(popup_class => true, hidden: !defined?(visible) || !visible, "fr-pb-2w fr-px-2w": true) }
|
2023-03-14 17:23:17 +01:00
|
|
|
|
= form_tag(defined?(form_path) ? form_path : terminer_instructeur_dossier_path(dossier.procedure, dossier), data: { turbo: true, turbo_confirm: confirm }, method: :post, multipart: true) do
|
2017-11-29 11:47:18 +01:00
|
|
|
|
- if title == 'Accepter'
|
2023-02-28 16:01:50 +01:00
|
|
|
|
= text_area :dossier, :motivation, class: 'fr-input', placeholder: placeholder, required: false
|
2022-11-09 12:09:24 +01:00
|
|
|
|
- if dossier.attestation_template&.activated?
|
2019-10-14 15:34:04 +02:00
|
|
|
|
%p.help
|
2021-05-26 15:16:30 +02:00
|
|
|
|
L’acceptation du dossier envoie automatiquement
|
2019-10-14 15:38:04 +02:00
|
|
|
|
= link_to 'une attestation', apercu_attestation_instructeur_dossier_path(dossier.procedure, dossier), target: '_blank', rel: 'noopener', title: "Voir l'attestation qui sera envoyée à l'usager"
|
|
|
|
|
à l'usager.
|
2018-04-06 13:09:37 +02:00
|
|
|
|
|
|
|
|
|
- unspecified_attestation_champs = dossier.unspecified_attestation_champs
|
|
|
|
|
- if unspecified_attestation_champs.present?
|
|
|
|
|
.warning
|
2021-05-26 15:16:30 +02:00
|
|
|
|
Attention, les valeurs suivantes n’ont pas été renseignées mais sont nécessaires pour pouvoir envoyer une attestation valide :
|
2021-03-23 13:45:55 +01:00
|
|
|
|
- unspecified_annotations_privees, unspecified_champs = unspecified_attestation_champs.partition(&:private)
|
2018-04-06 13:09:37 +02:00
|
|
|
|
|
|
|
|
|
- if unspecified_champs.present?
|
|
|
|
|
%h4 Champs de la demande
|
|
|
|
|
%ul
|
|
|
|
|
- unspecified_attestation_champs.each do |unspecified_champ|
|
|
|
|
|
%li= unspecified_champ.libelle
|
|
|
|
|
|
|
|
|
|
- if unspecified_annotations_privees.present?
|
|
|
|
|
%h4 Annotations privées
|
|
|
|
|
%ul
|
|
|
|
|
- unspecified_annotations_privees.each do |unspecified_annotations_privee|
|
|
|
|
|
%li= unspecified_annotations_privee.libelle
|
2018-08-09 16:56:51 +02:00
|
|
|
|
- else
|
2023-02-28 16:01:50 +01:00
|
|
|
|
= text_area :dossier, :motivation, class: 'fr-input', placeholder: placeholder, required: true
|
2019-04-29 11:33:59 +02:00
|
|
|
|
.optional-justificatif{ id: "justificatif_motivation_suggest_#{popup_class}", onclick: "DS.showImportJustificatif('#{popup_class}');" }
|
2023-03-14 17:23:17 +01:00
|
|
|
|
%button.fr-btn.fr-btn--tertiary-no-outline.fr-btn--icon-left.fr-icon-attachment-line.fr-ml-0{ type: 'button', onclick: "DS.showImportJustificatif('accept');" }= defined?(button_justificatif_label) ? button_justificatif_label : "Ajouter un justificatif (optionnel)"
|
2019-02-18 17:52:15 +01:00
|
|
|
|
.hidden{ id: "justificatif_motivation_import_#{popup_class}" }
|
2023-03-27 16:07:24 +02:00
|
|
|
|
= file_field :dossier, :justificatif_motivation, direct_upload: true, id: "dossier_justificatif_motivation_#{popup_class}",onchange: "DS.showDeleteJustificatif('#{popup_class}');"
|
2023-03-27 17:45:06 +02:00
|
|
|
|
.hidden.js_delete_motivation{ id: "delete_motivation_import_#{popup_class}" }
|
|
|
|
|
%button.fr-btn.fr-btn--tertiary-no-outline.fr-btn--icon-left.fr-icon-delete-line.fr-ml-0.fr-mt-1w{ type: 'button', onclick: "DS.deleteJustificatif('#{popup_class}');" } Supprimer le justificatif
|
2023-03-27 17:21:35 +02:00
|
|
|
|
.fr-mt-2w
|
2023-03-27 14:44:45 +02:00
|
|
|
|
= button_tag "Annuler", type: :reset, class: 'fr-btn fr-btn--secondary', onclick: 'DS.motivationCancel();'
|
2023-03-14 17:23:17 +01:00
|
|
|
|
= button_tag defined?(process_button) ? process_button : 'Valider la décision', name: :process_action, value: process_action, class: 'fr-btn fr-mr-0', title: title
|