Fix Polls link in admin menu

The link was marked as active and hidden by foundation when we were in
the "Booths Assignments" section.
This commit is contained in:
Javi Martín
2020-02-05 22:15:58 +01:00
parent 2b87b9ed19
commit 00484fe5f7
3 changed files with 12 additions and 4 deletions

View File

@@ -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?