Files
forum/app/views/users/index.html.erb

41 lines
1.4 KiB
Plaintext
Executable File

<div class="module" style="padding:15px 25px 0px 25px;">
<div class='module_header'>
<h4>Users Administration</h4>
</div>
<table id="users">
<thead>
<tr>
<th><strong>Username</strong></th>
<th><strong>Email</strong</th>
<th><strong>Login Count</strong></th>
<th><strong>Last Sign In</strong></th>
<th><strong>Admin</strong></th>
<th><strong>Created At</strong></th>
<th><strong>Last Edited</strong></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<% @users.each do |user| %>
<tr>
<th><%= user.username %></th>
<th><%= user.email %></th>
<th><%= user.sign_in_count %></th>
<th><%if user.last_sign_in_at.blank? %>Never logged in<% else %><%= time_ago_in_words(user.last_sign_in_at.to_datetime)+' ago' %><% end %></th>
<th><%= user.admin? %></th>
<th><%= user.created_at.to_s(:datetime).downcase %></th>
<th><%= user.updated_at.to_s(:datetime).downcase %></th>
<th><%= button_to "Edit", edit_user_path(user), :class => 'btn', :method => "get" %></th>
<th> <%= button_to "Delete", user, :action => "destroy", :confirm => "Are you sure?", :method => :delete, :class =>'btn btn-danger' %> </th>
</tr>
<% end %>
</tbody>
</table>
<div align="center"> <%= paginate(@users)%> </div>
<p><%= button_to "New User", new_user_path, :class => 'btn btn-primary', :method => "get" %></p>
<div class="clear"></div>
</div>