highlights correct item in admin menu

This commit is contained in:
rgarcia
2017-09-08 22:00:45 +02:00
parent 45d2fdd201
commit 0ad24c1080
2 changed files with 7 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ module AdminHelper
end
def menu_polls?
["polls", "questions", "officers", "booths", "officer_assignments", "booth_assignments", "recounts", "results"].include? controller_name
["polls", "questions", "officers", "booths", "officer_assignments", "booth_assignments", "recounts", "results", "shifts"].include? controller_name
end
def menu_profiles?

View File

@@ -73,12 +73,15 @@
<%= link_to t('admin.menu.poll_officers'), admin_officers_path %>
</li>
<li <%# "class=active" if controller_name == "booths" %>>
<li <%= "class=active" if controller_name == "booths" &&
action_name != "available" %>>
<%= link_to t('admin.menu.poll_booths'), admin_booths_path %>
</li>
<li <%= "class=active" if controller_name == "booths" %>>
<%= link_to t('admin.menu.poll_shifts'), admin_booths_path %>
<li <%= "class=active" if controller_name == "shifts" ||
controller_name == "booths" &&
action_name == "available" %>>
<%= link_to t('admin.menu.poll_shifts'), available_admin_booths_path %>
</li>
</ul>
</li>