demarches-normaliennes/app/views/shared/dossiers/_edit.html.haml

62 lines
2.8 KiB
Text
Raw Normal View History

.dossier-edit.container
= render partial: "shared/dossiers/submit_is_over", locals: { dossier: dossier }
- if dossier.brouillon?
- form_options = { url: brouillon_dossier_url(dossier), method: :patch }
2018-09-06 11:39:46 +02:00
- else
- form_options = { url: modifier_dossier_url(dossier), method: :patch }
2018-04-13 16:56:00 +02:00
= form_for dossier, form_options.merge({ html: { id: 'dossier-edit-form', class: 'form', multipart: true, novalidate: 'novalidate' } }) do |f|
.prologue
2021-04-17 18:49:00 +02:00
%p.mandatory-explanation= t('utils.asterisk_html')
- if dossier.brouillon?
%p.mandatory-explanation
= t('views.shared.dossiers.edit.autosave')
- if dossier.france_connect_information.present?
= render partial: "shared/dossiers/france_connect_informations", locals: { user_information: dossier.france_connect_information }
- if notice_url(dossier.procedure).present?
= link_to notice_url(dossier.procedure), target: '_blank', rel: 'noopener', class: 'button notice', title: "Pour vous aider à remplir votre dossier, vous pouvez consulter le guide de cette démarche." do
%span.icon.info>
Guide de la démarche
%hr
- if dossier.show_groupe_instructeur_selector?
%span{ data: { controller: dossier.brouillon? ? 'autosave' : 'check-conditions' } }
= f.label :groupe_instructeur_id do
= dossier.procedure.routing_criteria_name
%span.mandatory *
= f.select :groupe_instructeur_id,
dossier.procedure.groupe_instructeurs.where(closed: false).order(:label).map { |gi| [gi.label, gi.id] },
{ include_blank: dossier.brouillon? }
2019-09-24 06:31:08 +02:00
- dossier.champs.each do |champ|
= fields_for champ.input_name, champ do |form|
= render partial: "shared/dossiers/editable_champs/editable_champ", locals: { form: form, champ: champ }
- if !dossier.for_procedure_preview?
.dossier-edit-sticky-footer
.send-dossier-actions-bar
- if dossier.brouillon?
= render partial: 'users/dossiers/autosave'
- if dossier.can_transition_to_en_construction?
2021-04-17 18:49:00 +02:00
= f.button t('views.shared.dossiers.edit.submit_dossier'),
name: :submit_draft,
value: true,
class: 'button send primary',
disabled: !current_user.owns?(dossier),
data: { 'disable-with': "Envoi en cours…" }
- else
2021-04-17 18:49:00 +02:00
= f.button t('views.shared.dossiers.edit.save_changes'),
2018-04-13 16:56:00 +02:00
class: 'button send primary',
data: { 'disable-with': "Envoi en cours…" }
- if dossier.brouillon? && !current_user.owns?(dossier)
.send-notice.invite-cannot-submit
En tant quinvité, vous pouvez remplir ce formulaire mais le titulaire du dossier doit le déposer lui-même.
= render partial: "shared/dossiers/submit_is_over", locals: { dossier: dossier }