From 7ee62a170d39afb34c3176a30f2952bd5f338314 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Mon, 19 Jun 2023 15:19:58 +0200 Subject: [PATCH 1/3] harmonize admin header for dashboard view --- .../administrateurs/_breadcrumbs.html.haml | 23 +++++++++++++------ .../locales/views/layouts/_breadcrumb.en.yml | 2 +- .../locales/views/layouts/_breadcrumb.fr.yml | 6 ++--- .../procedures/show.html.haml_spec.rb | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/app/views/administrateurs/_breadcrumbs.html.haml b/app/views/administrateurs/_breadcrumbs.html.haml index e0f96e56e..0b3c69c0b 100644 --- a/app/views/administrateurs/_breadcrumbs.html.haml +++ b/app/views/administrateurs/_breadcrumbs.html.haml @@ -22,12 +22,21 @@ - if defined?(metadatas) .metadatas.pb-3 - %h1.fr-h6.fr-mb-0= t('created_at', scope: [:layouts, :breadcrumb], number: @procedure.id, date: @procedure.created_at.strftime('%d/%m/%Y')) + %h1.fr-h6.fr-mb-1w + = @procedure.libelle + %span.fr-text--sm + = t('created_at', scope: [:layouts, :breadcrumb], number: @procedure.id, date: @procedure.created_at.strftime('%d/%m/%Y')) + - if @procedure.close? - %p.fr-h2= t('closed_at', scope: [:layouts, :breadcrumb], date: @procedure.closed_at.strftime('%d/%m/%Y')) - %p - - if @procedure.locked? - = t('published', scope: [:layouts, :breadcrumb]) - = link_to commencer_url(@procedure.path), commencer_url(@procedure.path) - - else + %span.fr-badge.fr-badge--warning + = t('closed_at', scope: [:layouts, :breadcrumb], date: @procedure.closed_at.strftime('%d/%m/%Y')) + + - elsif @procedure.locked? + .flex + %span.fr-badge.fr-badge--success.fr-mr-1w + = t('published', scope: [:layouts, :breadcrumb]) + = link_to commencer_url(@procedure.path), commencer_url(@procedure.path), class: "fr-link" + + - else + %span.fr-badge.fr-badge--info = t('draft', scope: [:layouts, :breadcrumb]) diff --git a/config/locales/views/layouts/_breadcrumb.en.yml b/config/locales/views/layouts/_breadcrumb.en.yml index 61c5e6746..7c9037d2c 100644 --- a/config/locales/views/layouts/_breadcrumb.en.yml +++ b/config/locales/views/layouts/_breadcrumb.en.yml @@ -7,7 +7,7 @@ en: preview: "Preview the form" continue: "Continue" continue_title: "You can comeback using this link" - created_at: "Procedure n° %{number} created at %{date}" + created_at: "- n° %{number} created at %{date}" closed_at: "Closed at %{date}" published: "Published" draft: "Draft" diff --git a/config/locales/views/layouts/_breadcrumb.fr.yml b/config/locales/views/layouts/_breadcrumb.fr.yml index 605fae51a..87da3c361 100644 --- a/config/locales/views/layouts/_breadcrumb.fr.yml +++ b/config/locales/views/layouts/_breadcrumb.fr.yml @@ -7,7 +7,7 @@ fr: preview: "Prévisualiser le formulaire" continue: "Continuer" continue_title: "Vous pourrez revenir ici par la suite" - created_at: "Démarche n° %{number}, créée le %{date}" + created_at: "- n° %{number}, créée le %{date}" closed_at: "Close le %{date}" - published: "Publiée – " - draft: "Brouillon" + published: "Publiée" + draft: "En test" diff --git a/spec/views/administrateurs/procedures/show.html.haml_spec.rb b/spec/views/administrateurs/procedures/show.html.haml_spec.rb index f1059f158..57224b13b 100644 --- a/spec/views/administrateurs/procedures/show.html.haml_spec.rb +++ b/spec/views/administrateurs/procedures/show.html.haml_spec.rb @@ -22,7 +22,7 @@ describe 'administrateurs/procedures/show', type: :view do end describe 'procedure path is not customized' do - it { expect(rendered).to have_content('Brouillon') } + it { expect(rendered).to have_content('En test') } end describe 'archive button' do From 87347d34c63ad8e6f0bf17190acf30e10aa4b19c Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Thu, 22 Jun 2023 15:38:49 +0200 Subject: [PATCH 2/3] change date with status + add a title on the page regarding to Olivier Figma --- .../administrateurs/_breadcrumbs.html.haml | 19 +++++++++++-------- .../administrateurs/procedures/show.html.haml | 9 +++++---- .../locales/views/layouts/_breadcrumb.en.yml | 4 ++-- .../locales/views/layouts/_breadcrumb.fr.yml | 4 ++-- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/app/views/administrateurs/_breadcrumbs.html.haml b/app/views/administrateurs/_breadcrumbs.html.haml index 0b3c69c0b..3907e6022 100644 --- a/app/views/administrateurs/_breadcrumbs.html.haml +++ b/app/views/administrateurs/_breadcrumbs.html.haml @@ -24,19 +24,22 @@ .metadatas.pb-3 %h1.fr-h6.fr-mb-1w = @procedure.libelle - %span.fr-text--sm - = t('created_at', scope: [:layouts, :breadcrumb], number: @procedure.id, date: @procedure.created_at.strftime('%d/%m/%Y')) - if @procedure.close? - %span.fr-badge.fr-badge--warning - = t('closed_at', scope: [:layouts, :breadcrumb], date: @procedure.closed_at.strftime('%d/%m/%Y')) + .flex + %span.fr-badge.fr-badge--warning.fr-mr-1w + = t('closed', scope: [:layouts, :breadcrumb]) + = t('since', scope: [:layouts, :breadcrumb], date: l(@procedure.closed_at.to_date)) - elsif @procedure.locked? - .flex + = link_to commencer_url(@procedure.path), commencer_url(@procedure.path), class: "fr-link" + .flex.fr-mt-1w %span.fr-badge.fr-badge--success.fr-mr-1w = t('published', scope: [:layouts, :breadcrumb]) - = link_to commencer_url(@procedure.path), commencer_url(@procedure.path), class: "fr-link" + = t('since', scope: [:layouts, :breadcrumb], number: @procedure.id, date: l(@procedure.published_at.to_date)) - else - %span.fr-badge.fr-badge--info - = t('draft', scope: [:layouts, :breadcrumb]) + .flex + %span.fr-badge.fr-badge--new.fr-mr-1w + = t('draft', scope: [:layouts, :breadcrumb]) + = t('since', scope: [:layouts, :breadcrumb], number: @procedure.id, date: l(@procedure.created_at.to_date)) diff --git a/app/views/administrateurs/procedures/show.html.haml b/app/views/administrateurs/procedures/show.html.haml index 1929d1e63..04732db17 100644 --- a/app/views/administrateurs/procedures/show.html.haml +++ b/app/views/administrateurs/procedures/show.html.haml @@ -43,8 +43,9 @@ - if !@procedure.procedure_expires_when_termine_enabled? = render partial: 'administrateurs/procedures/suggest_expires_when_termine', locals: { procedure: @procedure } .fr-container - %h2.fr-mt-5w.fr-mb-3w.fr-h1 Indispensable avant publication - .fr-grid-row.fr-grid-row--gutters + %h2= "Gestion de la démarche № #{@procedure.id}" + %h3.fr-h6 Indispensable avant publication + .fr-grid-row.fr-grid-row--gutters.fr-mb-5w = render Procedure::Card::PresentationComponent.new(procedure: @procedure) = render Procedure::Card::ZonesComponent.new(procedure: @procedure) if Rails.application.config.ds_zonage_enabled = render Procedure::Card::ChampsComponent.new(procedure: @procedure) @@ -53,8 +54,8 @@ = render Procedure::Card::InstructeursComponent.new(procedure: @procedure) = render Procedure::Card::ModificationsComponent.new(procedure: @procedure) - %h2.fr-mt-5w.fr-mb-3w.fr-h1 Pour aller plus loin - .fr-grid-row.fr-grid-row--gutters + %h3.fr-h6 Pour aller plus loin + .fr-grid-row.fr-grid-row--gutters.fr-mb-5w = render Procedure::Card::AttestationComponent.new(procedure: @procedure) = render Procedure::Card::ExpertsComponent.new(procedure: @procedure) = render Procedure::Card::EmailsComponent.new(procedure: @procedure) diff --git a/config/locales/views/layouts/_breadcrumb.en.yml b/config/locales/views/layouts/_breadcrumb.en.yml index 7c9037d2c..91de48e10 100644 --- a/config/locales/views/layouts/_breadcrumb.en.yml +++ b/config/locales/views/layouts/_breadcrumb.en.yml @@ -7,7 +7,7 @@ en: preview: "Preview the form" continue: "Continue" continue_title: "You can comeback using this link" - created_at: "- n° %{number} created at %{date}" - closed_at: "Closed at %{date}" + since: "since %{date}" + closed: "Closed" published: "Published" draft: "Draft" diff --git a/config/locales/views/layouts/_breadcrumb.fr.yml b/config/locales/views/layouts/_breadcrumb.fr.yml index 87da3c361..d38f97271 100644 --- a/config/locales/views/layouts/_breadcrumb.fr.yml +++ b/config/locales/views/layouts/_breadcrumb.fr.yml @@ -7,7 +7,7 @@ fr: preview: "Prévisualiser le formulaire" continue: "Continuer" continue_title: "Vous pourrez revenir ici par la suite" - created_at: "- n° %{number}, créée le %{date}" - closed_at: "Close le %{date}" + since: "depuis le %{date}" + closed: "Close" published: "Publiée" draft: "En test" From 9c89719a51f535dfe9b97051d297dc2eed345e71 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Thu, 22 Jun 2023 15:52:21 +0200 Subject: [PATCH 3/3] fix specs --- spec/system/administrateurs/procedure_archive_and_export_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/system/administrateurs/procedure_archive_and_export_spec.rb b/spec/system/administrateurs/procedure_archive_and_export_spec.rb index 7ff0d437a..be511183e 100644 --- a/spec/system/administrateurs/procedure_archive_and_export_spec.rb +++ b/spec/system/administrateurs/procedure_archive_and_export_spec.rb @@ -7,6 +7,7 @@ describe 'Creating a new procedure', js: true do let(:procedure) do create(:procedure, :with_service, :with_instructeur, aasm_state: :publiee, + published_at: Date.today, administrateurs: [administrateur], libelle: 'libellé de la procédure', path: 'libelle-de-la-procedure')