From 00484fe5f701f0f8bc3452a3b0c88573f9dc9c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 5 Feb 2020 22:15:58 +0100 Subject: [PATCH] Fix Polls link in admin menu The link was marked as active and hidden by foundation when we were in the "Booths Assignments" section. --- app/helpers/admin_helper.rb | 8 +++++--- app/views/admin/_menu.html.erb | 2 +- spec/features/admin/poll/booth_assigments_spec.rb | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index d9ff773fc..f3f3a9715 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -33,12 +33,14 @@ module AdminHelper end def menu_polls? - %w[polls active_polls recounts results questions answers].include?(controller_name) || - controller.class.parent == Admin::Poll::Questions::Answers + controller.class.parent == Admin::Poll::Questions::Answers || + %w[polls active_polls recounts results questions answers].include?(controller_name) && + action_name != "booth_assignments" end def menu_booths? - %w[officers booths shifts booth_assignments officer_assignments].include?(controller_name) + %w[officers booths shifts booth_assignments officer_assignments].include?(controller_name) || + controller_name == "polls" && action_name == "booth_assignments" end def menu_profiles? diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 16e860b1f..525dbf770 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -57,7 +57,7 @@ <%= t("admin.menu.title_booths") %> -