From abe0e321ac733e80698f4a6539fcb7fd12620dbf Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Wed, 3 Jun 2020 14:55:36 +0200 Subject: [PATCH 1/2] include the libelle with the redirection link --- app/helpers/application_helper.rb | 13 +++++++++++++ app/views/layouts/_new_header.haml | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e7f399a48..68000c339 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -122,6 +122,19 @@ module ApplicationHelper end end + def root_path_info_for_profile(nav_bar_profile) + case nav_bar_profile + when :administrateur + [admin_procedures_path, "Aller au panneau d'administration"] + when :instructeur + [instructeur_procedures_path, 'Aller à la liste des démarches'] + when :user + [dossiers_path, 'Aller à la liste des dossiers'] + else + [root_path, "Aller à la page d'accueil"] + end + end + def try_format_date(date) date.present? ? I18n.l(date) : '' end diff --git a/app/views/layouts/_new_header.haml b/app/views/layouts/_new_header.haml index 7967eca97..f7aab0319 100644 --- a/app/views/layouts/_new_header.haml +++ b/app/views/layouts/_new_header.haml @@ -18,9 +18,10 @@ - if params[:controller] == 'users/commencer' = link_to 'Revenir en arrière', url_for(:back), class: "button", title: "Revenir sur le site de mon administration" - else - = link_to root_path_for_profile(nav_bar_profile), class: 'header-logo justify-center', title: "Aller à la page d'accueil de demarches-simplifiees.fr" do + - root_profile_link, root_profile_libelle = root_path_info_for_profile(nav_bar_profile) + = link_to root_profile_link, class: 'header-logo justify-center', title: root_profile_libelle do = image_tag 'marianne.svg', alt: 'Liberté, égalité, fraternité', width: '65px' - = link_to root_path_for_profile(nav_bar_profile), class: 'header-logo justify-center', title: "Aller à la page d'accueil de demarches-simplifiees.fr" do + = link_to root_profile_link, class: 'header-logo justify-center', title: root_profile_libelle do %span.big.site-title> demarches-simplifiees.fr %span.small.site-title> d-s.fr From e6efddd886209977be9b606db78f5cb254453acd Mon Sep 17 00:00:00 2001 From: clemkeirua Date: Wed, 3 Jun 2020 15:10:26 +0200 Subject: [PATCH 2/2] remove redundant links --- app/assets/stylesheets/new_design/new_header.scss | 1 + app/views/layouts/_new_header.haml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/new_design/new_header.scss b/app/assets/stylesheets/new_design/new_header.scss index 27cac962d..37e403aa7 100644 --- a/app/assets/stylesheets/new_design/new_header.scss +++ b/app/assets/stylesheets/new_design/new_header.scss @@ -26,6 +26,7 @@ $header-mobile-breakpoint: 550px; .header-logo { display: flex; flex-wrap: wrap; + align-items: center; img { margin-right: 10px; diff --git a/app/views/layouts/_new_header.haml b/app/views/layouts/_new_header.haml index f7aab0319..d2734cadd 100644 --- a/app/views/layouts/_new_header.haml +++ b/app/views/layouts/_new_header.haml @@ -21,7 +21,6 @@ - root_profile_link, root_profile_libelle = root_path_info_for_profile(nav_bar_profile) = link_to root_profile_link, class: 'header-logo justify-center', title: root_profile_libelle do = image_tag 'marianne.svg', alt: 'Liberté, égalité, fraternité', width: '65px' - = link_to root_profile_link, class: 'header-logo justify-center', title: root_profile_libelle do %span.big.site-title> demarches-simplifiees.fr %span.small.site-title> d-s.fr