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

86 lines
4 KiB
Text
Raw Normal View History

.dossier-edit.container
= render partial: "shared/dossiers/submit_is_over", locals: { dossier: dossier }
2018-04-13 16:56:00 +02:00
- if apercu
- form_options = { url: '', method: :get }
2018-09-06 11:39:46 +02:00
- elsif 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
2019-11-19 17:55:30 +01:00
= form_for dossier, form_options.merge({ html: { id: 'dossier-edit-form', class: dossier_form_class(dossier), multipart: true } }) do |f|
.prologue
%p.mandatory-explanation
2020-06-16 14:13:29 +02:00
Les champs suivis dun astérisque (
%span.mandatory> *
) sont obligatoires.
- if dossier.brouillon?
%p.mandatory-explanation
2019-11-19 17:55:30 +01:00
- if autosave_available?(dossier)
Votre dossier est enregistré automatiquement après chaque modification. Vous pouvez à tout moment fermer la fenêtre et reprendre plus tard là où vous en étiez.
- else
Pour enregistrer votre dossier et le reprendre plus tard, cliquez sur le bouton « Enregistrer le brouillon » en bas à gauche du formulaire.
- if !apercu && dossier.user.france_connect_information.present?
= render partial: "shared/dossiers/france_connect_informations", locals: { individual: dossier.individual }
- 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
2019-09-24 06:31:08 +02:00
- if dossier.procedure.routee?
= f.label :groupe_instructeur_id do
= dossier.procedure.routing_criteria_name
%span.mandatory *
-# The routing dropdown has 'include_blank: false', because otherwise a blank
-# value may nullify the groupe_instructeur and thus the link between the dossier
-# and its procedure.
-#
-# If, one day, we need to make clearer to the user that they must actually choose an
-# option, THINK TWICE before adding a blank option, and what would happen if the form is
-# saved when the blank option is selected.
-# Instead please consider other possibilities; like using CSS to gray out the default option,
-# or adding some "(please select an option)" wording aside the label of the default group.
-# CSS
2019-09-24 06:31:08 +02:00
= f.select :groupe_instructeur_id,
dossier.procedure.groupe_instructeurs.order(:label).map { |gi| [gi.label, gi.id] },
{ include_blank: false }
2019-09-24 06:31:08 +02:00
= f.fields_for :champs, dossier.champs do |champ_form|
- champ = champ_form.object
= render partial: "shared/dossiers/editable_champs/editable_champ",
locals: { champ: champ, form: champ_form }
2018-04-13 16:56:00 +02:00
- if !apercu
.dossier-edit-sticky-footer
.send-dossier-actions-bar
- if dossier.brouillon?
- if autosave_available?(dossier)
= render partial: 'users/dossiers/autosave'
- else
= f.button 'Enregistrer le brouillon',
formnovalidate: true,
class: 'button send secondary',
data: { 'disable-with': "Envoi en cours…" }
- if dossier.can_transition_to_en_construction?
= f.button 'Déposer le dossier',
name: :submit_draft,
value: true,
class: 'button send primary',
disabled: !current_user.owns?(dossier),
data: { 'disable-with': "Envoi en cours…" }
- else
= f.button 'Enregistrer les modifications du dossier',
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 }