2019-01-16 11:57:58 +01:00
|
|
|
- content_for(:title, @procedure.libelle)
|
|
|
|
|
|
|
|
.commencer.form
|
|
|
|
- if !user_signed_in?
|
2021-08-19 18:25:32 +02:00
|
|
|
%h2.huge-title= t('views.commencer.show.start_procedure')
|
2023-01-03 14:46:10 +01:00
|
|
|
= render partial: 'shared/france_connect_login', locals: { url: commencer_france_connect_path(path: @procedure.path, prefill_token: @prefilled_dossier&.prefill_token) }
|
|
|
|
= link_to commencer_sign_up_path(path: @procedure.path, prefill_token: @prefilled_dossier&.prefill_token), class: 'fr-btn fr-btn--lg fr-my-2w' do
|
2021-08-19 18:25:32 +02:00
|
|
|
= t('views.shared.account.create')
|
2022-10-06 22:51:34 +02:00
|
|
|
%span.optional-on-small-screens.fr-ml-1v
|
2020-07-22 10:32:20 +02:00
|
|
|
#{APPLICATION_NAME}
|
2023-01-03 14:46:10 +01:00
|
|
|
= link_to t('views.shared.account.already_user'), commencer_sign_in_path(path: @procedure.path, prefill_token: @prefilled_dossier&.prefill_token), class: 'fr-btn fr-btn--secondary fr-btn--lg fr-my-2w'
|
2019-01-16 11:57:58 +01:00
|
|
|
|
|
|
|
- else
|
2022-07-13 11:07:57 +02:00
|
|
|
- revision = @revision.draft? ? @revision : @procedure.revisions.where.not(id: @procedure.draft_revision_id)
|
|
|
|
- dossiers = current_user.dossiers.visible_by_user.where(revision: revision)
|
2019-01-16 11:57:58 +01:00
|
|
|
- drafts = dossiers.merge(Dossier.state_brouillon)
|
|
|
|
- not_drafts = dossiers.merge(Dossier.state_not_brouillon)
|
|
|
|
|
2023-02-08 14:38:01 +01:00
|
|
|
- if @prefilled_dossier
|
|
|
|
%h2.huge-title= t('views.commencer.show.prefilled_draft')
|
2023-02-09 11:02:07 +01:00
|
|
|
%p= t('views.commencer.show.prefilled_draft_detail_html', time_ago: time_ago_in_words(@prefilled_dossier.created_at), procedure: @procedure.libelle)
|
2023-04-26 16:54:50 +02:00
|
|
|
= link_to t('views.commencer.show.go_to_prefilled_file'), url_for_dossier(@prefilled_dossier), class: 'fr-btn fr-btn--lg fr-my-2w'
|
2019-01-16 11:57:58 +01:00
|
|
|
|
2023-02-08 14:38:01 +01:00
|
|
|
- elsif dossiers.empty?
|
|
|
|
= link_to t('views.commencer.show.start_procedure'), url_for_new_dossier(@revision), class: 'fr-btn fr-btn--lg fr-my-2w'
|
2023-01-03 14:46:10 +01:00
|
|
|
|
2022-07-13 11:08:54 +02:00
|
|
|
- elsif drafts.size == 1 && not_drafts.empty?
|
2019-01-21 15:19:17 +01:00
|
|
|
- dossier = drafts.first
|
2021-08-19 18:25:32 +02:00
|
|
|
%h2.huge-title= t('views.commencer.show.already_draft')
|
2019-01-21 15:19:17 +01:00
|
|
|
%p
|
2021-08-19 18:25:32 +02:00
|
|
|
= t('views.commencer.show.already_draft_detail_html', time_ago: time_ago_in_words(dossier.created_at), procedure: dossier.procedure.libelle)
|
2023-04-26 16:54:50 +02:00
|
|
|
= link_to t('views.commencer.show.continue_file'), url_for_dossier(dossier), class: 'fr-btn fr-btn--lg fr-my-2w'
|
2022-10-06 22:51:34 +02:00
|
|
|
= link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: 'fr-btn fr-btn--lg fr-btn--secondary fr-my-2w'
|
2019-01-16 11:57:58 +01:00
|
|
|
|
2022-07-13 11:08:54 +02:00
|
|
|
- elsif not_drafts.size == 1
|
2019-01-21 15:19:17 +01:00
|
|
|
- dossier = not_drafts.first
|
2021-08-19 18:25:32 +02:00
|
|
|
%h2.huge-title= t('views.commencer.show.already_not_draft')
|
2019-01-21 15:19:17 +01:00
|
|
|
%p
|
2021-12-06 15:49:17 +01:00
|
|
|
= t('views.commencer.show.already_not_draft_detail_html', time_ago: time_ago_in_words(dossier.depose_at), procedure: dossier.procedure.libelle)
|
2023-04-26 16:54:50 +02:00
|
|
|
= link_to t('views.commencer.show.show_my_submitted_file'), url_for_dossier(dossier), class: 'fr-btn fr-btn--lg fr-my-2w'
|
2022-10-06 22:51:34 +02:00
|
|
|
= link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: 'fr-btn fr-btn--lg fr-btn--secondary fr-my-2w'
|
2019-01-16 11:57:58 +01:00
|
|
|
|
|
|
|
- else
|
2021-04-17 18:49:00 +02:00
|
|
|
%h2.huge-title= t('views.commencer.show.existing_dossiers')
|
2022-10-06 13:02:25 +02:00
|
|
|
= link_to t('views.commencer.show.show_dossiers'), dossiers_path, class: "fr-btn fr-btn--lg fr-my-2w"
|
|
|
|
= link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: "fr-btn fr-btn--lg fr-btn--secondary fr-my-2w"
|
2020-02-27 17:39:19 +01:00
|
|
|
|
2021-03-03 18:20:34 +01:00
|
|
|
- if @procedure.feature_enabled?(:dossier_pdf_vide)
|
2020-03-04 15:51:33 +01:00
|
|
|
%hr
|
2021-08-19 18:25:32 +02:00
|
|
|
%p= t('views.commencer.show.want_empty_pdf', service: @procedure&.service&.nom, adresse: @procedure&.service&.adresse)
|
|
|
|
|
2020-03-04 15:51:33 +01:00
|
|
|
%br
|
2022-12-01 13:29:08 +01:00
|
|
|
= link_to t('views.commencer.show.download_empty_pdf'), commencer_dossier_vide_for_revision_path(@revision), class: "fr-btn fr-btn--lg fr-btn--secondary fr-my-2w"
|