Merge pull request #5215 from betagouv/better-alt-main-title

#5162 - Amélioration des libellés vers l'accueil
This commit is contained in:
Paul Chavard 2020-06-04 15:15:49 +02:00 committed by GitHub
commit 123646c88a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 2 deletions

View file

@ -26,6 +26,7 @@ $header-mobile-breakpoint: 550px;
.header-logo {
display: flex;
flex-wrap: wrap;
align-items: center;
img {
margin-right: 10px;

View file

@ -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

View file

@ -18,9 +18,9 @@
- 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
%span.big.site-title> demarches-simplifiees.fr
%span.small.site-title> d-s.fr