Merge pull request #2807 from 16yuki0702/fix_issue_2783
Fix active item on admin menu
This commit is contained in:
@@ -21,11 +21,11 @@ module AdminHelper
|
||||
end
|
||||
|
||||
def menu_polls?
|
||||
%w[polls questions answers].include?(controller_name)
|
||||
%w[polls questions answers 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 booth_assignments officer_assignments].include?(controller_name)
|
||||
end
|
||||
|
||||
def menu_profiles?
|
||||
|
||||
@@ -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 recounts results).include?(controller_name) %>>
|
||||
<%= link_to t("admin.menu.polls"), admin_polls_path %>
|
||||
</li>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<strong><%= t("admin.menu.title_booths") %></strong>
|
||||
</a>
|
||||
<ul id="booths_menu" <%= "class=is-active" if menu_booths? || controller_name == "polls" && action_name == "booth_assignments" %>>
|
||||
<li <%= "class=is-active" if controller_name == "officers" %>>
|
||||
<li <%= "class=is-active" if %w(officers officer_assignments).include?(controller_name) %>>
|
||||
<%= link_to t("admin.menu.poll_officers"), admin_officers_path %>
|
||||
</li>
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
</li>
|
||||
|
||||
<li <%= "class=is-active" if (controller_name == "polls" && action_name == "booth_assignments") ||
|
||||
(controller_name == "booth_assignments" && action_name == "manage") %>>
|
||||
controller_name == "booth_assignments" %>>
|
||||
<%= link_to t("admin.menu.poll_booth_assignments"), booth_assignments_admin_polls_path %>
|
||||
</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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user