demarches-normaliennes/app/views/layouts/_new_header.haml
2017-09-21 10:41:53 +02:00

69 lines
3.1 KiB
Text

.new-header{ class: current_page?(root_path) ? nil : "new-header-with-border" }
.header-inner-content
.flex.align-center
-# TODO delete new_ui when old UI is no longer used
= link_to root_path(new_ui: 1), class: "header-logo" do
%img{ src: image_url("header/logo-tps.svg") }
- if gestionnaire_signed_in?
- current_url = request.path_info
%ul.header-tabs
- if current_gestionnaire.procedures.count > 0
%li
= link_to "Procédures", procedures_path, class: (controller_name != 'avis') ? "active" : nil
- if current_gestionnaire.avis.count > 0
%li
= link_to avis_index_path, class: (controller_name == 'avis') ? "active" : nil do
Avis
- avis_counter = current_gestionnaire.avis.without_answer.count
- if avis_counter > 0
%span.badge.warning= avis_counter
%li
= link_to "Ancienne interface", backoffice_dossiers_path
%ul.header-right-content
- if gestionnaire_signed_in?
%li
.header-search
= form_tag recherche_path, method: :get, class: "form" do
= text_field_tag "q", "#{@search_terms unless @search_terms.nil?}", placeholder: "Rechercher un dossier"
%button{ title: "Rechercher" }
= image_tag "icons/search-blue.svg"
%li
.header-menu-opener
= image_tag "icons/account-circle.svg", onclick: "javascript:TPS.toggleHeaderMenu(event);", title: "Mon compte"
%ul.header-menu
%li
.menu-item{ title: current_email }
= current_email
- if administration_signed_in?
%li
= link_to administrations_path, class: "menu-item menu-link" do
= image_tag "icons/super-admin.svg"
Passer en super-admin
- if SwitchDeviseProfileService.new(warden).multiple_devise_profile_connect?
- if user_signed_in?
%li
= link_to users_dossiers_path, class: "menu-item menu-link" do
= image_tag "icons/switch-profile.svg"
Passer en usager
- if gestionnaire_signed_in?
%li
= link_to procedures_path, class: "menu-item menu-link" do
= image_tag "icons/switch-profile.svg"
Passer en accompagnateur
- if administrateur_signed_in?
%li
= link_to admin_procedures_path, class: "menu-item menu-link" do
= image_tag "icons/switch-profile.svg"
Passer en administrateur
%li
= link_to destroy_user_session_path, method: :delete, class: "menu-item menu-link" do
= image_tag "icons/sign-out.svg"
Se déconnecter
- elsif request.path != new_user_session_path
%li
= link_to "Connexion", new_user_session_path, class: "button secondary"