Fix active item on admin menu

This commit is contained in:
16yuki0702
2018-07-27 15:45:42 +09:00
parent 4be40b9e5d
commit 57dbb0220a
2 changed files with 5 additions and 5 deletions

View File

@@ -21,11 +21,11 @@ module AdminHelper
end
def menu_polls?
%w[polls questions answers].include?(controller_name)
%w[polls questions answers booth_assignments officer_assignments recounts results].include?(controller_name)
end
def menu_booths?
%w[officers booths officer_assignments booth_assignments recounts results shifts].include?(controller_name)
%w[officers booths shifts].include?(controller_name)
end
def menu_profiles?

View File

@@ -7,7 +7,7 @@
<strong><%= t("admin.menu.title_polls") %></strong>
</a>
<ul id="polls_menu" <%= "class=is-active" if menu_polls? || controller.class.parent == Admin::Poll::Questions::Answers %>>
<li <%= "class=is-active" if controller_name == "polls" && action_name != "booth_assignments" %>>
<li <%= "class=is-active" if %w(polls booth_assignments officer_assignments recounts results).include?(controller_name) %>>
<%= link_to t("admin.menu.polls"), admin_polls_path %>
</li>
@@ -40,7 +40,7 @@
</li>
<li <%= "class=is-active" if %w(shifts booths).include?(controller_name) &&
action_name == "available" %>>
%w(available new).include?(action_name) %>>
<%= link_to t("admin.menu.poll_shifts"), available_admin_booths_path %>
</li>
</ul>
@@ -110,7 +110,7 @@
<ul <%= "class=is-active" if menu_customization? &&
controller.class.parent != Admin::Poll::Questions::Answers %>>
<li <%= "class=active" if menu_homepage? %>>
<li <%= "class=is-active" if menu_homepage? %>>
<%= link_to t("admin.menu.site_customization.homepage"), admin_homepage_path %>
</li>