2018-04-13 16:42:49 +02:00
|
|
|
.container
|
2018-06-25 18:07:16 +02:00
|
|
|
= render partial: "shared/dossiers/submit_is_over", locals: { dossier: dossier }
|
|
|
|
|
2018-04-13 16:42:49 +02:00
|
|
|
- if notice_url(dossier.procedure).present?
|
|
|
|
%p
|
|
|
|
Pour vous aider à remplir votre dossier, vous pouvez consulter
|
|
|
|
= link_to 'le guide de cette démarche', notice_url(dossier.procedure), { target: '_blank' }
|
|
|
|
|
2018-06-14 11:16:16 +02:00
|
|
|
%p.thanks Les champs avec une astérisque (*) sont obligatoires.
|
2018-04-13 16:42:49 +02:00
|
|
|
|
2018-04-13 16:56:00 +02:00
|
|
|
- if apercu
|
|
|
|
- form_options = { url: '', method: :get, html: { class: 'form', multipart: true } }
|
|
|
|
- else
|
2018-07-02 12:26:40 +02:00
|
|
|
- form_options = { html: { class: 'form', multipart: true, novalidate: dossier.brouillon? } }
|
2018-04-13 16:56:00 +02:00
|
|
|
|
|
|
|
= form_for dossier, form_options do |f|
|
2018-04-13 16:42:49 +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 }
|
|
|
|
|
|
|
|
- tpjs = dossier.types_de_piece_justificative.order('order_place ASC')
|
|
|
|
- if tpjs.present?
|
|
|
|
.card.featured
|
|
|
|
.card-title
|
|
|
|
Pièces-jointes
|
|
|
|
|
|
|
|
- tpjs.each do |tpj|
|
|
|
|
.pj-input
|
|
|
|
%label{ for: "piece_justificative_#{tpj.id}" }
|
|
|
|
= tpj.libelle
|
|
|
|
- if tpj.mandatory?
|
|
|
|
%span.mandatory *
|
|
|
|
|
|
|
|
%p.piece-description= tpj.description
|
|
|
|
|
|
|
|
- if tpj.lien_demarche.present?
|
|
|
|
%p.piece-description
|
|
|
|
Récupérer le formulaire vierge pour mon dossier :
|
|
|
|
= link_to "Télécharger", tpj.lien_demarche, target: :blank
|
|
|
|
|
|
|
|
- if dossier.was_piece_justificative_uploaded_for_type_id?(tpj.id)
|
|
|
|
- pj = dossier.retrieve_last_piece_justificative_by_type(tpj.id)
|
|
|
|
%p
|
|
|
|
Pièce-jointe déjà importée :
|
|
|
|
= link_to pj.original_filename, pj.content_url, target: :blank
|
|
|
|
|
|
|
|
= file_field_tag "piece_justificative_#{tpj.id}",
|
|
|
|
accept: PieceJustificative.accept_format,
|
|
|
|
max_file_size: 6.megabytes,
|
|
|
|
required: (tpj.mandatory? && !dossier.was_piece_justificative_uploaded_for_type_id?(tpj.id))
|
|
|
|
|
2018-04-13 16:56:00 +02:00
|
|
|
- if !apercu
|
|
|
|
.send-wrapper
|
|
|
|
= hidden_field_tag 'submit_action', 'draft'
|
|
|
|
|
|
|
|
- if dossier.brouillon?
|
|
|
|
= f.button 'Enregistrer le brouillon',
|
|
|
|
formnovalidate: true,
|
|
|
|
class: 'button send',
|
|
|
|
data: { action: 'draft', disable_with: 'Envoi...' }
|
2018-04-13 16:42:49 +02:00
|
|
|
|
2018-06-25 18:07:16 +02:00
|
|
|
- if current_user.owns?(dossier) && dossier.can_transition_to_en_construction?
|
2018-04-13 16:56:00 +02:00
|
|
|
= f.button 'Soumettre le dossier',
|
|
|
|
class: 'button send primary',
|
|
|
|
data: { action: 'submit', disable_with: 'Envoi...' }
|
2018-04-13 16:42:49 +02:00
|
|
|
|
2018-04-13 16:56:00 +02:00
|
|
|
- else
|
2018-06-18 16:45:38 +02:00
|
|
|
= f.button 'Enregistrer les modifications du dossier',
|
2018-04-13 16:42:49 +02:00
|
|
|
class: 'button send primary',
|
|
|
|
data: { action: 'submit', disable_with: 'Envoi...' }
|
2018-06-25 18:07:16 +02:00
|
|
|
|
|
|
|
= render partial: "shared/dossiers/submit_is_over", locals: { dossier: dossier }
|