AgileVentures/osra

View on GitHub
app/views/admin_users/index.html.erb

Summary

Maintainability
Test Coverage
<%=render partial: "layouts/content_title.erb", locals: {title: "Admin Users"} %>

<div class="main-content-header">
  <%= link_to 'New Admin User', new_admin_user_path,
    class: 'btn btn-default', role: 'button' %>
</div>

<div class="table-responsive">
  <table class="table table-hover" id="admin-users-index">
    <thead>
      <tr>
        <th>
          Email
        </th>
        <th>
          Last Sign In At
        </th>
        <th>
          Sign In Count
          <th>
            Actions
          </th>
      </tr>
    </thead>
    <tbody>
      <% @admin_users.each do |admin_user| %>
        <tr id="admin_user_<%= admin_user.id %>">
          <td>
            <%= admin_user.email %>
          </td>
          <td>
            <%= admin_user.current_sign_in_at %>
          <!-- See http://www.rubydoc.info/github/plataformatec/devise/Devise/Models/Trackable -->
          <!-- current_sign_in_at holds the timestamp of when the user last logged in          -->
          <!-- last_sign_in_at holds the timestamp of the user's previous login                -->
          <!-- but generally the term Last Sign In At refers to the last login, so current_sign_in_at -->
          </td>
          <td>
            <%= admin_user.sign_in_count %>
          </td>
          <td>
            <%= link_to 'Edit', edit_admin_user_path(admin_user) %>
            &nbsp;
            <% unless admin_user == current_admin_user %>
              <%= link_to 'Delete', admin_user_path(admin_user), method: :delete,
                data: { confirm: 'Are you sure?' } %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>

<div class="pagination">
  <%= will_paginate @admin_users, will_paginate_render_options %>
</div>