feat: when previous dossiers exist, show a preview

This commit is contained in:
simon lehericey 2023-10-09 22:53:35 +02:00
parent 95fb3671fb
commit 5b4c3df54c
3 changed files with 19 additions and 0 deletions

View file

@ -54,6 +54,15 @@
%ul.fr-btns-group.fr-btns-group--inline
%li= link_to t('views.commencer.show.show_dossiers'), dossiers_path(procedure_id: @procedure.id), class: "fr-btn"
%li= link_to t('views.commencer.show.start_new_file'), url_for_new_dossier(@revision), class: "fr-btn fr-btn--secondary"
- preview_dossiers = dossiers.order(created_at: :desc).limit(3)
%p= t('views.commencer.show.already_created', count: preview_dossiers.size)
%ul
- preview_dossiers.each do |dossier|
%li= link_to t('views.commencer.show.already_created_details_html',
id: number_with_html_delimiter(dossier.id),
created_at: time_ago_in_words(dossier.created_at),
state: dossier_display_state(dossier.state, lower: true)),
dossier_path(dossier)
- if @procedure.feature_enabled?(:dossier_pdf_vide)

View file

@ -225,6 +225,11 @@ en:
show_my_submitted_file: 'Show my submitted file'
want_empty_pdf: "You prefer to submit a paper form? You can download an empty PDF file, and send it to the right administration : %{service} - %{adresse}"
download_empty_pdf: 'Download an empty PDF file'
already_created:
one: "Your previous file :"
other: "Your last %{count} created files :"
already_created_details_html:
"N° %{id}, created %{created_at} ago and %{state}"
prefill_descriptions:
edit:
intro_html: "You'd like to allow your users to <strong>create a prefilled file</strong>, with data you already have, for the procedure « %{libelle} »."

View file

@ -221,6 +221,11 @@ fr:
show_my_submitted_file: 'Voir mon dossier déposé'
want_empty_pdf: "Vous souhaitez effectuer une demande par papier ? Vous pouvez télécharger un dossier vide au format PDF, et lenvoyer à ladministration concernée : %{service} - %{adresse}"
download_empty_pdf: 'Télécharger un dossier vide au format PDF'
already_created:
one: "Votre dernier dossier :"
other: "Vos %{count} derniers dossiers créés :"
already_created_details_html:
"N° %{id}, créé il y a %{created_at} et %{state}"
prefill_descriptions:
edit:
intro_html: "Vous souhaitez permettre à vos usager·ères la <strong>création d'un dossier prérempli</strong>, à partir de données dont vous disposez déjà, pour la démarche « %{libelle} »."