From 29a297575229edeaf31175449f09cfd5e999ffc9 Mon Sep 17 00:00:00 2001 From: Kara Diaby Date: Mon, 4 Nov 2024 17:54:08 +0000 Subject: [PATCH] Adapte les breadcrumbs sur l'interface instructeur --- app/views/instructeurs/_breadcrumbs.html.haml | 45 +++++++++++++++++++ .../instructeurs/archives/index.html.haml | 9 ++-- .../groupe_instructeurs/index.html.haml | 6 ++- .../procedures/administrateurs.html.haml | 5 ++- .../procedures/deleted_dossiers.html.haml | 6 ++- .../procedures/email_notifications.html.haml | 5 ++- .../procedures/email_usagers.html.haml | 5 ++- .../instructeurs/procedures/exports.html.haml | 6 ++- .../instructeurs/procedures/show.html.haml | 5 ++- .../instructeurs/procedures/stats.html.haml | 6 ++- .../locales/views/layouts/_breadcrumb.en.yml | 2 +- .../locales/views/layouts/_breadcrumb.fr.yml | 2 +- 12 files changed, 87 insertions(+), 15 deletions(-) create mode 100644 app/views/instructeurs/_breadcrumbs.html.haml diff --git a/app/views/instructeurs/_breadcrumbs.html.haml b/app/views/instructeurs/_breadcrumbs.html.haml new file mode 100644 index 000000000..b4339980f --- /dev/null +++ b/app/views/instructeurs/_breadcrumbs.html.haml @@ -0,0 +1,45 @@ +%nav.fr-breadcrumb.mt-0{ role: "navigation", aria: { label: t('you_are_here', scope: [:layouts, :breadcrumb]) } } + %button.fr-breadcrumb__button{ aria: { expanded: "false", controls: "breadcrumb-1" } } + = t('show', scope: [:layouts, :breadcrumb]) + + .fr-collapse#breadcrumb-1 + %ol.fr-breadcrumb__list + %li= link_to t('root', scope: [:layouts, :breadcrumb]), root_path, class: 'fr-breadcrumb__link' + + - steps.each.with_index do |step, i| + - if i == 0 + %li= link_to "#{step[0]} - Suivi des dossiers", step[1], class: 'fr-breadcrumb__link' + - else + %li= link_to step[0], step[1], class: 'fr-breadcrumb__link' + +- if defined?(metadatas) + .metadatas.pb-3 + %h1.fr-h6.fr-mb-1w + = @procedure.libelle + + - if @procedure.close? + .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? + = link_to commencer_url(@procedure.path), commencer_url(@procedure.path), class: "fr-link" + .flex.fr-mt-1w + + - if @procedure.api_entreprise_token_expired_or_expires_soon? + %span.fr-badge.fr-badge--error.fr-mr-1w + = t('to_modify', scope: [:layouts, :breadcrumb]) + + %span.fr-badge.fr-badge--success.fr-mr-1w + = t('published', scope: [:layouts, :breadcrumb]) + = t('since', scope: [:layouts, :breadcrumb], number: @procedure.id, date: l(@procedure.published_at.to_date)) + + - else + %p.fr-mb-1w + = t('more_info_on_test', scope: [:layouts, :breadcrumb]) + = link_to t('go_to_FAQ', scope: [:layouts, :breadcrumb]), t("url_FAQ", scope: [:layouts, :breadcrumb]), title: new_tab_suffix(t('go_to_FAQ', 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/instructeurs/archives/index.html.haml b/app/views/instructeurs/archives/index.html.haml index b04375126..a34c4d96c 100644 --- a/app/views/instructeurs/archives/index.html.haml +++ b/app/views/instructeurs/archives/index.html.haml @@ -1,11 +1,12 @@ - content_for(:title, "Archives pour #{@procedure.libelle}") --# = render partial: 'administrateurs/breadcrumbs', --# locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)], --# ['Archives']] } + .sub-header - .fr-container.flex + .fr-container.flex.column + = render partial: 'instructeurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)], + [t('instructeurs.dossiers.header.banner.downloads')]] } = render partial: 'instructeurs/procedures/header', locals: { procedure: @procedure } diff --git a/app/views/instructeurs/groupe_instructeurs/index.html.haml b/app/views/instructeurs/groupe_instructeurs/index.html.haml index 3eeefd1ed..11611f7e3 100644 --- a/app/views/instructeurs/groupe_instructeurs/index.html.haml +++ b/app/views/instructeurs/groupe_instructeurs/index.html.haml @@ -1,7 +1,11 @@ - content_for(:title, "Notifications pour #{@procedure.libelle}") .sub-header - .fr-container.flex + .fr-container.flex.column + = render partial: 'instructeurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)], + ['Gestion des instructeurs']] } + = render partial: 'instructeurs/procedures/header', locals: { procedure: @procedure } diff --git a/app/views/instructeurs/procedures/administrateurs.html.haml b/app/views/instructeurs/procedures/administrateurs.html.haml index dde38335e..fe542e5ff 100644 --- a/app/views/instructeurs/procedures/administrateurs.html.haml +++ b/app/views/instructeurs/procedures/administrateurs.html.haml @@ -1,7 +1,10 @@ - content_for(:title, "Administrateurs de #{@procedure.libelle}") .sub-header - .fr-container.flex + .fr-container.flex.column + = render partial: 'instructeurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), administrateurs_instructeur_procedure_path(@procedure)],[t('instructeurs.dossiers.header.banner.administrators_list')]] } + = render partial: 'instructeurs/procedures/header', locals: { procedure: @procedure } .container diff --git a/app/views/instructeurs/procedures/deleted_dossiers.html.haml b/app/views/instructeurs/procedures/deleted_dossiers.html.haml index b4d9b5934..04101b41f 100644 --- a/app/views/instructeurs/procedures/deleted_dossiers.html.haml +++ b/app/views/instructeurs/procedures/deleted_dossiers.html.haml @@ -1,7 +1,11 @@ - content_for(:title, "#{@procedure.libelle}") .sub-header - .fr-container.flex + .fr-container.flex.column + = render partial: 'instructeurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)], + ['Historique des dossiers supprimés']] } + = render partial: 'instructeurs/procedures/header', locals: { procedure: @procedure } diff --git a/app/views/instructeurs/procedures/email_notifications.html.haml b/app/views/instructeurs/procedures/email_notifications.html.haml index e688abe7e..28a60e696 100644 --- a/app/views/instructeurs/procedures/email_notifications.html.haml +++ b/app/views/instructeurs/procedures/email_notifications.html.haml @@ -1,7 +1,10 @@ - content_for(:title, "Notifications pour #{@procedure.libelle}") .sub-header - .fr-container.flex + .fr-container.flex.column + = render partial: 'instructeurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)], + [t('instructeurs.dossiers.header.banner.notification_management')]] } = render partial: 'instructeurs/procedures/header', locals: { procedure: @procedure } diff --git a/app/views/instructeurs/procedures/email_usagers.html.haml b/app/views/instructeurs/procedures/email_usagers.html.haml index 974d4cf0a..dbf621dae 100644 --- a/app/views/instructeurs/procedures/email_usagers.html.haml +++ b/app/views/instructeurs/procedures/email_usagers.html.haml @@ -1,7 +1,10 @@ - content_for(:title, "Contacter les usagers pour #{@procedure.libelle}") .sub-header - .fr-container.flex + .fr-container.flex.column + = render partial: 'instructeurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)], + [t('instructeurs.dossiers.header.banner.contact_users')]] } = render partial: 'instructeurs/procedures/header', locals: { procedure: @procedure } diff --git a/app/views/instructeurs/procedures/exports.html.haml b/app/views/instructeurs/procedures/exports.html.haml index 3e0a40b43..f06d2d760 100644 --- a/app/views/instructeurs/procedures/exports.html.haml +++ b/app/views/instructeurs/procedures/exports.html.haml @@ -6,7 +6,11 @@ -# [t('.title')]] } .sub-header - .fr-container.flex + .fr-container.flex.column + = render partial: 'instructeurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)], + [t('instructeurs.dossiers.header.banner.exports_list')]] } + = render partial: 'instructeurs/procedures/header', locals: { procedure: @procedure } diff --git a/app/views/instructeurs/procedures/show.html.haml b/app/views/instructeurs/procedures/show.html.haml index b5208a1c4..d89c58da1 100644 --- a/app/views/instructeurs/procedures/show.html.haml +++ b/app/views/instructeurs/procedures/show.html.haml @@ -2,8 +2,9 @@ #procedure-show .sub-header - .fr-container.flex - + .fr-container.flex.column + = render partial: 'instructeurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)]] } = render partial: 'header', locals: { procedure: @procedure, statut: @statut } .procedure-actions diff --git a/app/views/instructeurs/procedures/stats.html.haml b/app/views/instructeurs/procedures/stats.html.haml index 8b45c323f..0ffd9d5c6 100644 --- a/app/views/instructeurs/procedures/stats.html.haml +++ b/app/views/instructeurs/procedures/stats.html.haml @@ -2,7 +2,11 @@ - content_for(:title, title) .sub-header - .fr-container.flex + .fr-container.flex.column + = render partial: 'instructeurs/breadcrumbs', + locals: { steps: [[@procedure.libelle.truncate_words(10), instructeur_procedure_path(@procedure)], + [t('instructeurs.dossiers.header.banner.statistics')]] } + = render partial: 'instructeurs/procedures/header', locals: { procedure: @procedure } diff --git a/config/locales/views/layouts/_breadcrumb.en.yml b/config/locales/views/layouts/_breadcrumb.en.yml index 129028235..d6003ef6f 100644 --- a/config/locales/views/layouts/_breadcrumb.en.yml +++ b/config/locales/views/layouts/_breadcrumb.en.yml @@ -1,7 +1,7 @@ en: layouts: breadcrumb: - root: "Home" + root: "Home - List of procedures" you_are_here: "You are here" show: Show breadcrumb preview: "Preview the form" diff --git a/config/locales/views/layouts/_breadcrumb.fr.yml b/config/locales/views/layouts/_breadcrumb.fr.yml index cc60f2133..5fd78a4d2 100644 --- a/config/locales/views/layouts/_breadcrumb.fr.yml +++ b/config/locales/views/layouts/_breadcrumb.fr.yml @@ -1,7 +1,7 @@ fr: layouts: breadcrumb: - root: "Accueil" + root: "Accueil - Liste des démarches" you_are_here: "Vous êtes ici" show: "Voir le fil d’Ariane" preview: "Prévisualiser le formulaire"