Place the menu in the <nav> tag in desktop version
This commit is contained in:
parent
06b8194359
commit
31bf30830d
2 changed files with 64 additions and 63 deletions
|
@ -8,83 +8,84 @@
|
||||||
- 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" }
|
||||||
.fr-header__body
|
%nav{ :role => "navigation", "aria-label" => t('layouts.header.main_menu') }
|
||||||
.fr-container
|
.fr-header__body
|
||||||
.fr-header__body-row
|
.fr-container
|
||||||
.fr-header__brand.fr-enlarge-link
|
.fr-header__body-row
|
||||||
.fr-header__brand-top
|
.fr-header__brand.fr-enlarge-link
|
||||||
.fr-header__logo
|
.fr-header__brand-top
|
||||||
%p.fr-logo{ lang: "fr" }
|
.fr-header__logo
|
||||||
République
|
%p.fr-logo{ lang: "fr" }
|
||||||
= succeed "Française" do
|
République
|
||||||
%br/
|
= succeed "Française" do
|
||||||
.fr-header__navbar
|
%br/
|
||||||
- if is_search_enabled
|
.fr-header__navbar
|
||||||
%button.fr-btn--search.fr-btn{ "aria-controls" => "search-modal", "data-fr-opened" => "false", :title => t('views.users.dossiers.search.search_file') }= t('views.users.dossiers.search.search_file')
|
- if is_search_enabled
|
||||||
%button#navbar-burger-button.fr-btn--menu.fr-btn{ "aria-controls" => "modal-header__menu", "data-fr-opened" => "false", title: "Menu" } Menu
|
%button.fr-btn--search.fr-btn{ "aria-controls" => "search-modal", "data-fr-opened" => "false", :title => t('views.users.dossiers.search.search_file') }= t('views.users.dossiers.search.search_file')
|
||||||
.fr-header__service
|
%button#navbar-burger-button.fr-btn--menu.fr-btn{ "aria-controls" => "modal-header__menu", "data-fr-opened" => "false", title: "Menu" } Menu
|
||||||
- root_profile_link, root_profile_libelle = root_path_info_for_profile(nav_bar_profile)
|
.fr-header__service
|
||||||
|
- root_profile_link, root_profile_libelle = root_path_info_for_profile(nav_bar_profile)
|
||||||
|
|
||||||
= link_to root_profile_link, title: "#{root_profile_libelle} — #{Current.application_name}" do
|
= link_to root_profile_link, title: "#{root_profile_libelle} — #{Current.application_name}" do
|
||||||
%span.fr-header__service-title{ lang: "fr" }= Current.application_name
|
%span.fr-header__service-title{ lang: "fr" }= Current.application_name
|
||||||
|
|
||||||
.fr-header__tools
|
.fr-header__tools
|
||||||
.fr-header__tools-links.relative
|
.fr-header__tools-links.relative
|
||||||
|
|
||||||
|
%ul.fr-btns-group.flex.align-center
|
||||||
|
- if instructeur_signed_in? || user_signed_in?
|
||||||
|
%li
|
||||||
|
= render partial: 'layouts/account_dropdown', locals: { nav_bar_profile: nav_bar_profile, dossier: dossier }
|
||||||
|
- elsif (request.path != new_user_session_path && request.path !=agent_connect_path)
|
||||||
|
- if request.path == new_user_registration_path
|
||||||
|
%li.fr-hidden-sm.fr-unhidden-lg.fr-link--sm.fr-mb-2w.fr-mr-1v= t('views.shared.account.already_user_question')
|
||||||
|
%li= link_to 'Agent', agent_connect_path, class: "fr-btn fr-btn--tertiary fr-icon-government-fill fr-btn--icon-left"
|
||||||
|
%li= link_to t('views.shared.account.signin'), new_user_session_path, class: "fr-btn fr-btn--tertiary fr-icon-account-circle-fill fr-btn--icon-left"
|
||||||
|
|
||||||
%ul.fr-btns-group.flex.align-center
|
|
||||||
- if instructeur_signed_in? || user_signed_in?
|
|
||||||
%li
|
%li
|
||||||
= render partial: 'layouts/account_dropdown', locals: { nav_bar_profile: nav_bar_profile, dossier: dossier }
|
- if dossier.present? && nav_bar_profile == :user
|
||||||
- elsif (request.path != new_user_session_path && request.path !=agent_connect_path)
|
= render partial: 'shared/help/help_dropdown_dossier', locals: { dossier: dossier }
|
||||||
- if request.path == new_user_registration_path
|
|
||||||
%li.fr-hidden-sm.fr-unhidden-lg.fr-link--sm.fr-mb-2w.fr-mr-1v= t('views.shared.account.already_user_question')
|
|
||||||
%li= link_to 'Agent', agent_connect_path, class: "fr-btn fr-btn--tertiary fr-icon-government-fill fr-btn--icon-left"
|
|
||||||
%li= link_to t('views.shared.account.signin'), new_user_session_path, class: "fr-btn fr-btn--tertiary fr-icon-account-circle-fill fr-btn--icon-left"
|
|
||||||
|
|
||||||
%li
|
- elsif procedure.present? && (nav_bar_profile == :user || nav_bar_profile == :guest)
|
||||||
- if dossier.present? && nav_bar_profile == :user
|
= render partial: 'shared/help/help_dropdown_procedure', locals: { procedure: procedure }
|
||||||
= render partial: 'shared/help/help_dropdown_dossier', locals: { dossier: dossier }
|
|
||||||
|
|
||||||
- elsif procedure.present? && (nav_bar_profile == :user || nav_bar_profile == :guest)
|
- elsif nav_bar_profile == :instructeur
|
||||||
= render partial: 'shared/help/help_dropdown_procedure', locals: { procedure: procedure }
|
= render partial: 'shared/help/help_dropdown_instructeur'
|
||||||
|
- else
|
||||||
- elsif nav_bar_profile == :instructeur
|
// NB: on mobile in order to have links correctly aligned, we need a left icon
|
||||||
= render partial: 'shared/help/help_dropdown_instructeur'
|
= link_to t('help'), t("links.common.faq.url"), class: 'fr-btn dropdown-button', title: t('help')
|
||||||
- else
|
|
||||||
// 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')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- if localization_enabled?
|
- if localization_enabled?
|
||||||
%li= render partial: 'layouts/locale_dropdown'
|
%li= render partial: 'layouts/locale_dropdown'
|
||||||
|
|
||||||
|
|
||||||
- if params[:controller] == 'recherche'
|
- if params[:controller] == 'recherche'
|
||||||
= render partial: 'layouts/search_dossiers_form'
|
= render partial: 'layouts/search_dossiers_form'
|
||||||
|
|
||||||
- if is_instructeur_context
|
- if is_instructeur_context
|
||||||
= render partial: 'layouts/search_dossiers_form'
|
= render partial: 'layouts/search_dossiers_form'
|
||||||
|
|
||||||
- if is_expert_context
|
- if is_expert_context
|
||||||
= render partial: 'layouts/search_dossiers_form'
|
= render partial: 'layouts/search_dossiers_form'
|
||||||
|
|
||||||
= render SwitchDomainBannerComponent.new(user: current_user)
|
= render SwitchDomainBannerComponent.new(user: current_user)
|
||||||
|
|
||||||
#modal-header__menu.fr-header__menu.fr-modal{ "aria-labelledby": "navbar-burger-button" }
|
#modal-header__menu.fr-header__menu.fr-modal{ "aria-labelledby": "navbar-burger-button" }
|
||||||
.fr-container
|
.fr-container
|
||||||
%button.fr-btn--close.fr-btn{ "aria-controls" => "modal-header__menu", title: t('close_modal', scope: [:layouts, :header]) }= t('close_modal', scope: [:layouts, :header])
|
%button.fr-btn--close.fr-btn{ "aria-controls" => "modal-header__menu", title: t('close_modal', scope: [:layouts, :header]) }= t('close_modal', scope: [:layouts, :header])
|
||||||
.fr-header__menu-links
|
.fr-header__menu-links
|
||||||
-# populated by dsfr js
|
-# populated by dsfr js
|
||||||
|
|
||||||
- if content_for?(:main_navigation)
|
- if content_for?(:main_navigation)
|
||||||
= yield(:main_navigation)
|
= yield(:main_navigation)
|
||||||
- elsif is_administrateur_context
|
- elsif is_administrateur_context
|
||||||
= render 'administrateurs/main_navigation'
|
= render 'administrateurs/main_navigation'
|
||||||
- elsif is_instructeur_context || is_expert_context
|
- elsif is_instructeur_context || is_expert_context
|
||||||
= render MainNavigation::InstructeurExpertNavigationComponent.new
|
= render MainNavigation::InstructeurExpertNavigationComponent.new
|
||||||
- elsif is_user_context
|
- elsif is_user_context
|
||||||
= render 'users/main_navigation'
|
= render 'users/main_navigation'
|
||||||
|
|
||||||
|
|
||||||
= yield(:notice_info)
|
= yield(:notice_info)
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue