From 6ed1d7f833d8b4e15cc31967c3223a612c6b93dc Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Mon, 12 Feb 2018 16:26:56 +0100 Subject: [PATCH] [Fix 1413] User header should not contain accompagnateurs links --- .../new_gestionnaire/gestionnaire_controller.rb | 4 ++++ app/controllers/new_user/user_controller.rb | 4 ++++ app/views/layouts/_new_header.haml | 8 ++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/controllers/new_gestionnaire/gestionnaire_controller.rb b/app/controllers/new_gestionnaire/gestionnaire_controller.rb index c675f9566..2ffe8ae50 100644 --- a/app/controllers/new_gestionnaire/gestionnaire_controller.rb +++ b/app/controllers/new_gestionnaire/gestionnaire_controller.rb @@ -3,5 +3,9 @@ module NewGestionnaire layout "new_application" before_action :authenticate_gestionnaire! + + def nav_bar_profile + :gestionnaire + end end end diff --git a/app/controllers/new_user/user_controller.rb b/app/controllers/new_user/user_controller.rb index 566424ecf..dc74e3d12 100644 --- a/app/controllers/new_user/user_controller.rb +++ b/app/controllers/new_user/user_controller.rb @@ -3,5 +3,9 @@ module NewUser layout "new_application" before_action :authenticate_user! + + def nav_bar_profile + :user + end end end diff --git a/app/views/layouts/_new_header.haml b/app/views/layouts/_new_header.haml index f515c3238..2bdc8be3e 100644 --- a/app/views/layouts/_new_header.haml +++ b/app/views/layouts/_new_header.haml @@ -1,3 +1,5 @@ +- nav_bar_profile = controller.try(:nav_bar_profile) + .new-header{ class: current_page?(root_path) ? nil : "new-header-with-border" } .header-inner-content @@ -5,7 +7,7 @@ = link_to root_path, class: "header-logo" do %img{ src: image_url("header/logo-tps.svg") } - - if gestionnaire_signed_in? + - if nav_bar_profile == :gestionnaire && gestionnaire_signed_in? - current_url = request.path_info %ul.header-tabs - if current_gestionnaire.procedures.count > 0 @@ -29,13 +31,15 @@ – par email : contact@tps.apientreprise.fr %ul.header-right-content - - if gestionnaire_signed_in? + - if nav_bar_profile == :gestionnaire && gestionnaire_signed_in? %li .header-search = form_tag recherche_path, method: :get, class: "form" do = text_field_tag "q", "#{@search_terms if @search_terms.present?}", placeholder: "Rechercher un dossier" %button{ title: "Rechercher" } = image_tag "icons/search-blue.svg" + + - if gestionnaire_signed_in? || user_signed_in? %li .header-menu-opener = image_tag "icons/account-circle.svg", onclick: "javascript:TPS.toggleHeaderMenu(event);", title: "Mon compte"