demarches-normaliennes/app/views/layouts/_new_header.haml

85 lines
3.8 KiB
Text
Raw Normal View History

- 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
= link_to root_path, class: "header-logo" do
2017-07-03 16:01:44 +02:00
%img{ src: image_url("header/logo-tps.svg") }
- 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
- if current_gestionnaire.visible_procedures.count > 0
2017-09-06 11:13:59 +02:00
%li
= link_to "Procédures", gestionnaire_procedures_path, class: (controller_name != 'avis') ? "tab-link active" : 'tab-link'
2017-09-06 11:13:59 +02:00
- if current_gestionnaire.avis.count > 0
%li
= link_to gestionnaire_avis_index_path, class: (controller_name == 'avis') ? "tab-link active" : '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
%li
.tab-link.contact-link
Contact
.contact-details
Vous avez besoin daide ? Contactez-nous :
%br
par téléphone : 09 72 62 57 12
%br
par email : <a href="mailto:contact@tps.apientreprise.fr">contact@tps.apientreprise.fr</a>
2017-04-04 14:37:16 +02:00
- if nav_bar_profile == :user
%ul.header-tabs
%li
= link_to "Mes dossiers", users_dossiers_path, class: 'tab-link'
2017-06-22 14:56:59 +02:00
%ul.header-right-content
- if nav_bar_profile == :gestionnaire && gestionnaire_signed_in?
2017-06-22 14:56:59 +02:00
%li
.header-search
= 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"
- if gestionnaire_signed_in? || user_signed_in?
2017-06-22 16:45:57 +02:00
%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
2018-01-16 17:09:25 +01:00
= link_to manager_root_path, class: "menu-item menu-link" do
= 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?
- if user_signed_in? && nav_bar_profile != :usager
2017-06-26 14:01:54 +02:00
%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? && nav_bar_profile != :gestionnaire
2017-06-26 14:01:54 +02:00
%li
= 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"
Passer en accompagnateur
- 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
%li
2017-06-26 11:40:28 +02:00
= link_to "Connexion", new_user_session_path, class: "button secondary"