2018-05-30 18:45:46 +02:00
|
|
|
|
/ We can't use &. because the controller may not implement #nav_bar_profile
|
2018-02-12 16:26:56 +01:00
|
|
|
|
- nav_bar_profile = controller.try(:nav_bar_profile)
|
|
|
|
|
|
2017-06-22 14:56:59 +02:00
|
|
|
|
.new-header{ class: current_page?(root_path) ? nil : "new-header-with-border" }
|
2017-04-04 14:37:16 +02:00
|
|
|
|
.header-inner-content
|
2017-07-03 16:01:44 +02:00
|
|
|
|
|
|
|
|
|
.flex.align-center
|
2018-03-08 13:54:26 +01:00
|
|
|
|
= link_to root_path_for_profile(nav_bar_profile), class: "header-logo" do
|
2019-03-11 15:55:15 +01:00
|
|
|
|
= image_tag "header/logo-ds.svg", alt: "demarches-simplifiees.fr", class: "header-logo-wide"
|
|
|
|
|
= image_tag "header/logo-ds-narrow.svg", alt: "demarches-simplifiees.fr", class: "header-logo-narrow"
|
2017-07-03 16:01:44 +02:00
|
|
|
|
|
2018-02-12 16:26:56 +01:00
|
|
|
|
- if nav_bar_profile == :gestionnaire && gestionnaire_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
|
2018-02-19 19:25:34 +01:00
|
|
|
|
- if current_gestionnaire.visible_procedures.count > 0
|
2017-09-06 11:13:59 +02:00
|
|
|
|
%li
|
2018-09-05 14:48:42 +02:00
|
|
|
|
= active_link_to "Démarches", gestionnaire_procedures_path, active: :inclusive, class: 'tab-link'
|
2017-09-06 11:13:59 +02:00
|
|
|
|
- if current_gestionnaire.avis.count > 0
|
|
|
|
|
%li
|
2018-06-20 16:02:41 +02:00
|
|
|
|
= active_link_to gestionnaire_avis_index_path, active: :inclusive, class: 'tab-link' do
|
2017-09-20 15:49:49 +02:00
|
|
|
|
Avis
|
|
|
|
|
- avis_counter = current_gestionnaire.avis.without_answer.count
|
|
|
|
|
- if avis_counter > 0
|
|
|
|
|
%span.badge.warning= avis_counter
|
2017-11-21 16:26:12 +01:00
|
|
|
|
%li
|
|
|
|
|
.tab-link.contact-link
|
2018-10-18 18:21:59 +02:00
|
|
|
|
Aide
|
2017-11-21 16:26:12 +01:00
|
|
|
|
.contact-details
|
2018-10-18 18:25:46 +02:00
|
|
|
|
Besoin d’aide technique ? Contactez-nous
|
2018-10-18 18:24:45 +02:00
|
|
|
|
= contact_link("par email")
|
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
|
2018-06-27 14:47:02 +02:00
|
|
|
|
= active_link_to "Dossiers", dossiers_path, active: :inclusive, class: 'tab-link'
|
2018-02-26 16:54:10 +01:00
|
|
|
|
|
2017-06-22 14:56:59 +02:00
|
|
|
|
%ul.header-right-content
|
2018-02-12 16:26:56 +01:00
|
|
|
|
- if nav_bar_profile == :gestionnaire && gestionnaire_signed_in?
|
2017-06-22 14:56:59 +02:00
|
|
|
|
%li
|
|
|
|
|
.header-search
|
2018-02-21 13:42:12 +01:00
|
|
|
|
= form_tag gestionnaire_recherche_path, method: :get, class: "form" do
|
2018-01-11 19:04:39 +01:00
|
|
|
|
= text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: "Rechercher un dossier"
|
2017-06-22 14:56:59 +02:00
|
|
|
|
%button{ title: "Rechercher" }
|
|
|
|
|
= image_tag "icons/search-blue.svg"
|
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
|
|
|
|
|
.header-search
|
|
|
|
|
= form_tag recherche_dossiers_path, method: :post, class: "form" do
|
|
|
|
|
= text_field_tag :dossier_id, "", placeholder: "Numéro de dossier"
|
|
|
|
|
%button{ title: "Rechercher" }
|
|
|
|
|
= image_tag "icons/search-blue.svg"
|
|
|
|
|
|
2018-02-12 16:26:56 +01:00
|
|
|
|
- if gestionnaire_signed_in? || user_signed_in?
|
2017-06-22 16:45:57 +02:00
|
|
|
|
%li
|
2018-09-11 17:51:44 +02:00
|
|
|
|
%span.dropdown.header-menu-opener
|
|
|
|
|
%button.button.dropdown-button.header-menu-button
|
|
|
|
|
= image_tag "icons/account-circle.svg", title: "Mon compte"
|
|
|
|
|
%ul.header-menu.dropdown-content
|
2017-06-22 16:45:57 +02:00
|
|
|
|
%li
|
|
|
|
|
.menu-item{ title: current_email }
|
|
|
|
|
= current_email
|
2017-09-05 16:31:32 +02:00
|
|
|
|
- if administration_signed_in?
|
|
|
|
|
%li
|
2018-01-16 17:09:25 +01:00
|
|
|
|
= link_to manager_root_path, class: "menu-item menu-link" do
|
2017-09-05 16:31:32 +02:00
|
|
|
|
= image_tag "icons/super-admin.svg"
|
|
|
|
|
Passer en super-admin
|
2017-06-26 14:01:54 +02:00
|
|
|
|
- if SwitchDeviseProfileService.new(warden).multiple_devise_profile_connect?
|
2018-04-09 15:13:37 +02:00
|
|
|
|
- if user_signed_in? && nav_bar_profile != :user
|
2017-06-26 14:01:54 +02:00
|
|
|
|
%li
|
2018-06-27 14:47:02 +02:00
|
|
|
|
= link_to dossiers_path, class: "menu-item menu-link" do
|
2017-06-26 14:01:54 +02:00
|
|
|
|
= image_tag "icons/switch-profile.svg"
|
|
|
|
|
Passer en usager
|
2018-02-21 15:00:33 +01:00
|
|
|
|
- if gestionnaire_signed_in? && nav_bar_profile != :gestionnaire
|
2017-06-26 14:01:54 +02:00
|
|
|
|
%li
|
2018-02-21 15:06:21 +01:00
|
|
|
|
= link_to gestionnaire_procedures_path, class: "menu-item menu-link" do
|
2017-06-26 14:01:54 +02:00
|
|
|
|
= image_tag "icons/switch-profile.svg"
|
2018-08-29 22:11:38 +02:00
|
|
|
|
Passer en instructeur
|
2018-02-21 15:00:33 +01:00
|
|
|
|
- if administrateur_signed_in? && nav_bar_profile != :administrateur
|
2017-06-26 14:01:54 +02:00
|
|
|
|
%li
|
|
|
|
|
= link_to admin_procedures_path, class: "menu-item menu-link" do
|
|
|
|
|
= image_tag "icons/switch-profile.svg"
|
|
|
|
|
Passer en administrateur
|
|
|
|
|
|
2017-06-22 16:45:57 +02:00
|
|
|
|
%li
|
|
|
|
|
= link_to destroy_user_session_path, method: :delete, class: "menu-item menu-link" do
|
|
|
|
|
= image_tag "icons/sign-out.svg"
|
|
|
|
|
Se déconnecter
|
2017-06-22 14:56:59 +02:00
|
|
|
|
- elsif request.path != new_user_session_path
|
2018-12-24 15:07:18 +01:00
|
|
|
|
- if request.path == new_user_registration_path
|
|
|
|
|
%li
|
|
|
|
|
Vous avez déjà un compte ?
|
2017-06-22 14:56:59 +02:00
|
|
|
|
%li
|
2017-06-26 11:40:28 +02:00
|
|
|
|
= link_to "Connexion", new_user_session_path, class: "button secondary"
|