Merge pull request #10530 from demarches-simplifiees/a11y-fix-nav
Correction de la structure de navigation
This commit is contained in:
commit
cbe8d92f81
16 changed files with 74 additions and 79 deletions
|
@ -1,6 +1,6 @@
|
||||||
.fr-grid-row
|
.fr-grid-row
|
||||||
.fr-col-12
|
.fr-col-12
|
||||||
%nav.fr-translate.fr-nav
|
.fr-translate.fr-nav
|
||||||
.fr-nav__item.custom-fr-translate-flex-end
|
.fr-nav__item.custom-fr-translate-flex-end
|
||||||
%button.fr-translate__btn.translate-no-icon.fr-btn.fr-btn--tertiary.custom-fr-translate-no-icon{ "aria-controls" => "filters", "aria-expanded" => "false", title: t('.button.select_filters') }
|
%button.fr-translate__btn.translate-no-icon.fr-btn.fr-btn--tertiary.custom-fr-translate-no-icon{ "aria-controls" => "filters", "aria-expanded" => "false", title: t('.button.select_filters') }
|
||||||
= t('.button.select_filters')
|
= t('.button.select_filters')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%nav#header-navigation.fr-nav{ role: :navigation, "aria-label" => t('main_menu', scope: [:layouts, :header]) }
|
#header-navigation.fr-nav
|
||||||
%ul.fr-nav__list
|
%ul.fr-nav__list
|
||||||
- if instructeur?
|
- if instructeur?
|
||||||
%li.fr-nav__item
|
%li.fr-nav__item
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%nav#header-navigation.fr-nav{ role: 'navigation', 'aria-label': 'Menu principal administrateur' }
|
#header-navigation.fr-nav
|
||||||
%ul.fr-nav__list
|
%ul.fr-nav__list
|
||||||
%li.fr-nav__item= link_to 'Mes démarches', admin_procedures_path, class:'fr-nav__link', 'aria-current': current_page?(controller: 'administrateurs/procedures', action: :index) ? 'true' : nil
|
%li.fr-nav__item= link_to 'Mes démarches', admin_procedures_path, class:'fr-nav__link', 'aria-current': current_page?(controller: 'administrateurs/procedures', action: :index) ? 'true' : nil
|
||||||
- if Rails.application.config.ds_zonage_enabled
|
- if Rails.application.config.ds_zonage_enabled
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
- content_for(:main_navigation) do
|
- content_for(:main_navigation) do
|
||||||
%nav#header-navigation.fr-nav{ role: 'navigation', 'aria-label': 'Menu principal gestionnaire' }
|
#header-navigation.fr-nav
|
||||||
%ul.fr-nav__list
|
%ul.fr-nav__list
|
||||||
%li.fr-nav__item= link_to 'Mes groupes gestionnaires', gestionnaire_groupe_gestionnaires_path, class:'fr-nav__link', 'aria-current': current_page?(controller: 'groupe_gestionnaires', action: :index) ? 'page' : nil
|
%li.fr-nav__item= link_to 'Mes groupes gestionnaires', gestionnaire_groupe_gestionnaires_path, class:'fr-nav__link', 'aria-current': current_page?(controller: 'groupe_gestionnaires', action: :index) ? 'page' : nil
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%nav.fr-translate.fr-nav{ role: "navigation", "aria-label"=> t('menu_aria_label', scope: [:layouts]) }
|
%nav.fr-translate.fr-nav{ role: "navigation", "aria-label"=> t('my_account', scope: [:layouts]) }
|
||||||
.fr-nav__item
|
.fr-nav__item
|
||||||
%button.account-btn.fr-translate__btn.fr-btn{ "aria-controls" => "account", "aria-expanded" => "false", :title => t('my_account', scope: [:layouts]) }
|
%button.account-btn.fr-translate__btn.fr-btn{ "aria-controls" => "account", "aria-expanded" => "false", :title => t('my_account', scope: [:layouts]) }
|
||||||
%span= current_email
|
%span= current_email
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
- is_user_context = nav_bar_profile == :user
|
- is_user_context = nav_bar_profile == :user
|
||||||
- is_search_enabled = [params[:controller] == 'recherche', is_instructeur_context, is_expert_context, is_user_context && current_user.dossiers.count].any?
|
- is_search_enabled = [params[:controller] == 'recherche', is_instructeur_context, is_expert_context, is_user_context && current_user.dossiers.count].any?
|
||||||
%header{ class: ["fr-header", content_for?(:notice_info) && "fr-header__with-notice-info"], role: "banner", "data-controller": "dsfr-header" }
|
%header{ class: ["fr-header", content_for?(:notice_info) && "fr-header__with-notice-info"], role: "banner", "data-controller": "dsfr-header" }
|
||||||
|
%nav{ :role => "navigation", "aria-label" => t('layouts.header.main_menu') }
|
||||||
.fr-header__body
|
.fr-header__body
|
||||||
.fr-container
|
.fr-container
|
||||||
.fr-header__body-row
|
.fr-header__body-row
|
||||||
|
@ -52,7 +53,7 @@
|
||||||
= render partial: 'shared/help/help_dropdown_instructeur'
|
= render partial: 'shared/help/help_dropdown_instructeur'
|
||||||
- else
|
- else
|
||||||
// NB: on mobile in order to have links correctly aligned, we need a left icon
|
// NB: on mobile in order to have links correctly aligned, we need a left icon
|
||||||
= link_to t('help'), t("links.common.faq.url"), class: 'fr-btn dropdown-button', title: t('help')
|
= link_to t('help'), t("links.common.faq.url"), class: 'fr-btn dropdown-button'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%nav.fr-translate.fr-nav{ :role => "navigation", title: t('.select_locale') }
|
.fr-translate.fr-nav
|
||||||
.fr-nav__item
|
.fr-nav__item
|
||||||
%button.fr-translate__btn.fr-btn{ "aria-controls" => "translate", "aria-expanded" => "false", :title => t('.select_locale') }
|
%button.fr-translate__btn.fr-btn{ "aria-controls" => "translate", "aria-expanded" => "false", :title => t('.select_locale') }
|
||||||
= I18n.locale.upcase
|
= I18n.locale.upcase
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
- content_for(:main_navigation) do
|
- content_for(:main_navigation) do
|
||||||
%nav.fr-nav#header-navigation{ role: "navigation", aria: { label: 'Menu principal annonces' } }
|
#header-navigation.fr-nav
|
||||||
%ul.fr-nav__list
|
%ul.fr-nav__list
|
||||||
%li.fr-nav__item
|
%li.fr-nav__item
|
||||||
= link_to "Toutes les annonces", super_admins_release_notes_path, class: "fr-nav__link", target: "_self", aria: { current: action == :index ? "page" : nil }
|
= link_to "Toutes les annonces", super_admins_release_notes_path, class: "fr-nav__link", target: "_self", aria: { current: action == :index ? "page" : nil }
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
%nav#header-navigation.fr-nav{ role: :navigation, "aria-label" => t('main_menu', scope: [:layouts, :header]) }
|
#header-navigation.fr-nav
|
||||||
%ul.fr-nav__list
|
%ul.fr-nav__list
|
||||||
- if params[:controller] == 'users/commencer'
|
- if params[:controller] == 'users/commencer'
|
||||||
%li.fr-nav__item
|
%li.fr-nav__item
|
||||||
|
|
|
@ -2,7 +2,6 @@ en:
|
||||||
layouts:
|
layouts:
|
||||||
header:
|
header:
|
||||||
files: My files
|
files: My files
|
||||||
menu_aria_label: 'Menu my profile'
|
|
||||||
go_superadmin: "Switch to super-admin"
|
go_superadmin: "Switch to super-admin"
|
||||||
go_user: "Switch to user"
|
go_user: "Switch to user"
|
||||||
go_instructor: "Switch to instructor"
|
go_instructor: "Switch to instructor"
|
||||||
|
@ -11,7 +10,7 @@ en:
|
||||||
go_gestionnaire: "Switch to admins group manager"
|
go_gestionnaire: "Switch to admins group manager"
|
||||||
profile: "See my profile"
|
profile: "See my profile"
|
||||||
logout: "Log out"
|
logout: "Log out"
|
||||||
my_account: "My account"
|
my_account: "My profile"
|
||||||
connected_as: "connected as %{profile}"
|
connected_as: "connected as %{profile}"
|
||||||
instructeur: instructor
|
instructeur: instructor
|
||||||
administrateur: admin
|
administrateur: admin
|
||||||
|
|
|
@ -2,7 +2,6 @@ fr:
|
||||||
layouts:
|
layouts:
|
||||||
header:
|
header:
|
||||||
files: Mes dossiers
|
files: Mes dossiers
|
||||||
menu_aria_label: 'Menu mon profil'
|
|
||||||
go_superadmin: "Passer en super-admin"
|
go_superadmin: "Passer en super-admin"
|
||||||
go_user: "Passer en usager"
|
go_user: "Passer en usager"
|
||||||
go_instructor: "Passer en instructeur"
|
go_instructor: "Passer en instructeur"
|
||||||
|
@ -11,7 +10,7 @@ fr:
|
||||||
go_gestionnaire: "Passer en gestionnaire"
|
go_gestionnaire: "Passer en gestionnaire"
|
||||||
profile: "Voir mon profil"
|
profile: "Voir mon profil"
|
||||||
logout: "Se déconnecter"
|
logout: "Se déconnecter"
|
||||||
my_account: "Mon compte"
|
my_account: "Mon profil"
|
||||||
connected_as: "connecté en tant qu’%{profile}"
|
connected_as: "connecté en tant qu’%{profile}"
|
||||||
instructeur: instructeur
|
instructeur: instructeur
|
||||||
administrateur: administrateur
|
administrateur: administrateur
|
||||||
|
|
|
@ -2110,7 +2110,6 @@
|
||||||
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
|
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
|
||||||
<a
|
<a
|
||||||
class="fr-btn dropdown-button"
|
class="fr-btn dropdown-button"
|
||||||
title="Aide"
|
|
||||||
href="/faq"
|
href="/faq"
|
||||||
>Aide</a
|
>Aide</a
|
||||||
>
|
>
|
||||||
|
|
|
@ -2109,7 +2109,6 @@
|
||||||
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
|
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
|
||||||
<a
|
<a
|
||||||
class="fr-btn dropdown-button"
|
class="fr-btn dropdown-button"
|
||||||
title="Aide"
|
|
||||||
href="/faq"
|
href="/faq"
|
||||||
>Aide</a
|
>Aide</a
|
||||||
>
|
>
|
||||||
|
|
|
@ -2109,7 +2109,6 @@
|
||||||
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
|
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
|
||||||
<a
|
<a
|
||||||
class="fr-btn dropdown-button"
|
class="fr-btn dropdown-button"
|
||||||
title="Aide
|
|
||||||
href="/faq"
|
href="/faq"
|
||||||
>Aide</a
|
>Aide</a
|
||||||
>
|
>
|
||||||
|
|
|
@ -2109,7 +2109,6 @@
|
||||||
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
|
<!-- / NB: on mobile in order to have links correctly aligned, we need a left icon -->
|
||||||
<a
|
<a
|
||||||
class="fr-btn dropdown-button"
|
class="fr-btn dropdown-button"
|
||||||
title="Aide"
|
|
||||||
href="/faq"
|
href="/faq"
|
||||||
>Aide</a
|
>Aide</a
|
||||||
>
|
>
|
||||||
|
|
|
@ -130,7 +130,7 @@ module SystemHelpers
|
||||||
|
|
||||||
def log_out
|
def log_out
|
||||||
within('.fr-header .fr-container .fr-header__tools .fr-btns-group') do
|
within('.fr-header .fr-container .fr-header__tools .fr-btns-group') do
|
||||||
click_button(title: 'Mon compte')
|
click_button(title: 'Mon profil')
|
||||||
expect(page).to have_selector('#account.fr-collapse--expanded', visible: true)
|
expect(page).to have_selector('#account.fr-collapse--expanded', visible: true)
|
||||||
click_on 'Se déconnecter'
|
click_on 'Se déconnecter'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue