<div class="row">
  <div class="col-xs-12">
    <div class="page-header">
      <h1>Users</h1>
    </div>

    <% if @users.empty? %>
      <p>No Users</p>
    <% else %>

      <table class="table table-condensed table-hover">
        <thead>
        <tr>
          <th>Name</th>
          <th>Username</th>
          <th>Email</th>
          <th>Admin</th>
          <th></th>
        </tr>
        </thead>

        <tbody>
        <% @users.each do |user| %>
          <tr>
            <td><%= link_to user.full_name, edit_admin_user_path(user) %></td>
            <td><%= user.username %></td>
            <td><%= user.email %></td>
            <td><%= user.admin? %></td>
            <td>
              <%= link_to [:admin, user], method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' do %>
                <span class="glyphicon glyphicon-remove"></span>
              <% end %>
            </td>
          </tr>
        <% end %>
        </tbody>
      </table>
    <% end %>


  </div>
</div>
