YaleSTC/shifts

View on GitHub
app/views/layouts/_users_menu.html.erb

Summary

Maintainability
Test Coverage
<%# Admin Menu %>
<% if current_user && current_user.is_admin_of?(@department) && !@no_nav %>
    <% content_for :left_nav do %>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Manage Users <i class="fa fa-caret-right"></i></a>
        <ul class="dropdown-menu">
          <li><%= link_to "Show All Users", department_users_path(@department) %></li>
          <li><%= link_to "Add a User", new_department_user_path(@department) %></li>
        </ul>
      </li>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Manage Permissions <i class="fa fa-caret-right"></i></a>
        <ul class="dropdown-menu">
          <li><%= link_to "Show All Roles", department_roles_path(@department) %></li>
          <li><%= link_to "Add a Role", new_department_role_path(@department) %></li>
        </ul>
      </li>
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Manage Profiles <i class="fa fa-caret-right"></i></a>
        <ul class="dropdown-menu">
          <li><%= link_to "My Profile", user_profile_path(current_user.login) %></li>
              <li><%= link_to "Show All Profiles", user_profiles_path %></li>
          <li><%= link_to "Show Profile Fields", user_profile_fields_path %></li>
          <li><%= link_to "Add a Profile Field", new_user_profile_field_path %></li>
        </ul>
    </li>
    <% end %>
<% else %>
  <% content_for :left_nav do %>
    <li><%= link_to "My Profile", user_profile_path(current_user.login) %></li>
      <li><%= link_to "Show All Profiles", user_profiles_path %></li>
  <% end %>
<% end %>