Skip to content

Commit

Permalink
Add 'active' class to menu items (#4423)
Browse files Browse the repository at this point in the history
Add 'active' class to menu items

Updates to both Competitions and Results items. For result, it checks for 'persons' or 'media' controllers, as other results hare handled by php.

Made `active` class inclusion consistent

Adding incidents, wdc, delegate_reports, and results_submission controller checks.
  • Loading branch information
michaelrp authored and Alberto Pérez de Rada Fiol committed Aug 6, 2019
1 parent c6f218a commit 96cf7ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions WcaOnRails/app/views/layouts/_navigation.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>
<div class="navbar-collapse collapse disabled">
<ul class="nav navbar-nav">
<li class="dropdown <%= params[:controller] == 'static_pages' || params[:controller] == 'posts' ? 'active' : '' %>">
<li class="dropdown <%= Set['static_pages', 'posts'].include?(params[:controller]) ? 'active' : '' %>">
<a href="/" class="dropdown-toggle top-nav" data-toggle="dropdown" data-hover="dropdown">
<%= icon('fa', 'info-circle') %> <span class="hidden-sm"><%= t '.information' %></span> <span class="caret"></span>
</a>
Expand All @@ -44,7 +44,7 @@
<li><a href="<%= logo_path %>"><i><%= image_tag('wca_logo.svg', width: '16px') %></i> <%= t '.logo' %></a></li>
</ul>
</li>
<li class="dropdown">
<li class="dropdown <%= Set['competitions', 'delegate_reports', 'results_submission'].include?(params[:controller]) ? 'active' : '' %>">
<a href="" class="dropdown-toggle top-nav" data-toggle="dropdown" data-hover="dropdown">
<%= icon('fas', 'cube') %> <%= t '.competitions' %> <span class="caret"></span>
</a>
Expand All @@ -56,7 +56,7 @@
<% end %>
</ul>
</li>
<li class="dropdown">
<li class="dropdown <%= Set['persons', 'media'].include?(params[:controller]) ? 'active' : '' %>">
<a href="/results/" class="dropdown-toggle top-nav" data-toggle="dropdown" data-hover="dropdown">
<%= icon('fas', 'list-ol') %> <%= t '.results' %> <span class="caret"></span>
</a>
Expand All @@ -73,7 +73,7 @@
<li><a href="/results/misc/export.html"><%= icon('fas', 'download') %> <%= t '.db_export' %></a></li>
</ul>
</li>
<li class="dropdown <%= params[:controller] == 'regulations' ? 'active' : '' %>">
<li class="dropdown <%= Set['incidents', 'regulations', 'wdc'].include?(params[:controller]) ? 'active' : '' %>">
<a href="/regulations/" class="dropdown-toggle top-nav" data-toggle="dropdown" data-hover="dropdown">
<%= icon('fas', 'book') %> <span class="hidden-sm"><%= t '.regulations' %></span> <span class="caret"></span>
</a>
Expand Down

0 comments on commit 96cf7ba

Please sign in to comment.