2019-03-13 16:48:38 +01:00
|
|
|
-# We can't use &. because the controller may not implement #nav_bar_profile
|
2019-03-28 11:14:01 +01:00
|
|
|
- nav_bar_profile = controller.try(:nav_bar_profile) || :guest
|
2019-03-13 16:48:38 +01:00
|
|
|
- dossier = controller.try(:dossier_for_help)
|
2019-03-28 11:14:01 +01:00
|
|
|
- procedure = controller.try(:procedure_for_help)
|
2018-02-12 16:26:56 +01:00
|
|
|
|
2019-11-25 17:16:48 +01:00
|
|
|
%header.new-header{ class: current_page?(root_path) ? nil : "new-header-with-border", role: 'banner' }
|
2017-04-04 14:37:16 +02:00
|
|
|
.header-inner-content
|
2017-07-03 16:01:44 +02:00
|
|
|
|
2020-05-14 14:50:14 +02:00
|
|
|
.flex.align-center.justify-center
|
2019-08-30 17:12:29 +02:00
|
|
|
- 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
|
2020-06-03 14:55:36 +02:00
|
|
|
- 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
|
2020-11-21 00:15:31 +01:00
|
|
|
= image_tag HEADER_LOGO_SRC, alt: HEADER_LOGO_ALT, width: HEADER_LOGO_WIDTH, height: HEADER_LOGO_HEIGHT, loading: 'lazy'
|
2020-07-22 10:32:20 +02:00
|
|
|
%span.big.site-title>
|
|
|
|
= APPLICATION_NAME
|
|
|
|
%span.small.site-title>
|
|
|
|
= APPLICATION_SHORTNAME
|
2017-07-03 16:01:44 +02:00
|
|
|
|
2019-08-06 11:02:54 +02:00
|
|
|
- if nav_bar_profile == :instructeur && instructeur_signed_in?
|
2017-09-06 11:13:59 +02:00
|
|
|
- current_url = request.path_info
|
2017-08-28 10:46:27 +02:00
|
|
|
%ul.header-tabs
|
2021-04-23 14:56:17 +02:00
|
|
|
- if current_instructeur.procedures.any?
|
2017-09-06 11:13:59 +02:00
|
|
|
%li
|
2022-04-13 15:44:29 +02:00
|
|
|
= active_link_to t('utils.procedure'), instructeur_procedures_path, active: ['dossiers','procedures'].include?(controller_name), class: 'tab-link'
|
2021-04-23 14:56:17 +02:00
|
|
|
- if current_instructeur.user.expert && current_expert.avis_summary[:total] > 0
|
2021-06-29 11:37:48 +02:00
|
|
|
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
|
2021-03-26 20:25:14 +01:00
|
|
|
|
2021-03-22 10:07:51 +01:00
|
|
|
- if nav_bar_profile == :expert && expert_signed_in?
|
2021-03-26 20:25:14 +01:00
|
|
|
%ul.header-tabs
|
2021-04-23 14:56:17 +02:00
|
|
|
- if current_expert.user.instructeur && current_instructeur.procedures.any?
|
2021-03-26 20:25:14 +01:00
|
|
|
%li
|
2022-04-13 15:44:29 +02:00
|
|
|
= active_link_to t('utils.procedure'), instructeur_procedures_path, active: ['dossiers','procedures'].include?(controller_name), class: 'tab-link'
|
2021-03-26 20:25:14 +01:00
|
|
|
|
2021-04-23 14:56:17 +02:00
|
|
|
- if current_expert.avis_summary[:total] > 0
|
2021-06-29 11:37:48 +02:00
|
|
|
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
|
2017-04-04 14:37:16 +02:00
|
|
|
|
2018-02-26 16:54:10 +01:00
|
|
|
- if nav_bar_profile == :user
|
|
|
|
%ul.header-tabs
|
|
|
|
%li
|
2022-04-21 10:20:14 +02:00
|
|
|
= active_link_to t('.files'), dossiers_path, active: :inclusive, class: 'tab-link'
|
2021-06-29 11:39:44 +02:00
|
|
|
- if current_user.expert && current_expert.avis_summary[:total] > 0
|
|
|
|
= render partial: 'layouts/header/avis_tab', locals: { current_expert: current_expert }
|
2018-02-26 16:54:10 +01:00
|
|
|
|
2017-06-22 14:56:59 +02:00
|
|
|
%ul.header-right-content
|
2021-04-29 09:33:23 +02:00
|
|
|
- if params[:controller] == 'recherche'
|
|
|
|
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_index_path }
|
|
|
|
|
2019-08-06 11:02:54 +02:00
|
|
|
- if nav_bar_profile == :instructeur && instructeur_signed_in?
|
2017-06-22 14:56:59 +02:00
|
|
|
%li
|
2021-04-29 09:33:23 +02:00
|
|
|
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_index_path }
|
|
|
|
|
|
|
|
- if nav_bar_profile == :expert && expert_signed_in?
|
|
|
|
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_index_path }
|
2018-02-12 16:26:56 +01:00
|
|
|
|
2018-07-17 11:40:19 +02:00
|
|
|
- if nav_bar_profile == :user && user_signed_in? && current_user.dossiers.count > 2
|
|
|
|
%li
|
2020-04-03 15:09:57 +02:00
|
|
|
= render partial: 'layouts/search_dossiers_form', locals: { search_endpoint: recherche_dossiers_path }
|
2018-07-17 11:40:19 +02:00
|
|
|
|
2019-08-06 11:02:54 +02:00
|
|
|
- if instructeur_signed_in? || user_signed_in?
|
2017-06-22 16:45:57 +02:00
|
|
|
%li
|
2019-03-28 11:33:45 +01:00
|
|
|
= render partial: 'layouts/account_dropdown', locals: { nav_bar_profile: nav_bar_profile }
|
2017-06-26 14:01:54 +02:00
|
|
|
|
2022-02-24 12:22:36 +01:00
|
|
|
- elsif (request.path != new_user_session_path && request.path != agent_connect_path)
|
2018-12-24 15:07:18 +01:00
|
|
|
- if request.path == new_user_registration_path
|
|
|
|
%li
|
2021-08-20 10:52:01 +02:00
|
|
|
= t('views.shared.account.already_user_question')
|
2017-06-22 14:56:59 +02:00
|
|
|
%li
|
2021-08-20 10:52:01 +02:00
|
|
|
= link_to t('views.shared.account.signin'), new_user_session_path, class: "button secondary"
|
2019-03-11 17:27:05 +01:00
|
|
|
|
|
|
|
%li
|
2019-11-19 09:06:55 +01:00
|
|
|
- if dossier.present? && nav_bar_profile == :user
|
|
|
|
= render partial: 'shared/help/help_dropdown_dossier', locals: { dossier: dossier }
|
2019-03-25 16:04:30 +01:00
|
|
|
|
2019-11-19 09:06:55 +01:00
|
|
|
- elsif procedure.present? && (nav_bar_profile == :user || nav_bar_profile == :guest)
|
|
|
|
= render partial: 'shared/help/help_dropdown_procedure', locals: { procedure: procedure }
|
2019-03-28 11:14:01 +01:00
|
|
|
|
2019-11-19 09:06:55 +01:00
|
|
|
- elsif nav_bar_profile == :instructeur
|
|
|
|
= render partial: 'shared/help/help_dropdown_instructeur'
|
2019-03-25 16:04:30 +01:00
|
|
|
|
2019-11-19 09:06:55 +01:00
|
|
|
- else
|
|
|
|
= render partial: 'shared/help/help_button'
|
2021-05-12 16:30:35 +02:00
|
|
|
|
2021-08-24 11:39:15 +02:00
|
|
|
- if localization_enabled?
|
2021-05-25 13:36:32 +02:00
|
|
|
%li
|
|
|
|
= render partial: 'layouts/locale_dropdown'
|