Adding activity and form fields for user profiles
This commit is contained in:
30
app/views/users/activity.html.erb
Normal file
30
app/views/users/activity.html.erb
Normal file
@@ -0,0 +1,30 @@
|
||||
<h1>Recent User Activity</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Current Sign In</th>
|
||||
<th>Last Sign In</th>
|
||||
<th>Sign In Count</th>
|
||||
<th>Name</th>
|
||||
<th>Account Created</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% if !@users.blank? %>
|
||||
<% @users.sort_by(&:current_sign_in_at).reverse!.each do |user| %>
|
||||
<tr<%= " class='hidden'" if user.hidden? %>>
|
||||
<td><%= distance_of_time_in_words DateTime.now, user.current_sign_in_at %> ago</td>
|
||||
<td>
|
||||
<% if user.last_sign_in_at != user.current_sign_in_at %>
|
||||
<%= distance_of_time_in_words DateTime.now, user.last_sign_in_at %> ago
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= user.sign_in_count %> times</td>
|
||||
<td><%= link_to user.name, user %></td>
|
||||
<td><%= distance_of_time_in_words DateTime.now, user.created_at %> ago</td>
|
||||
<td><%= link_to 'Edit', edit_user_path(user) if can? :update, user %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<% end %>
|
||||
<% if current_user.admin? %>
|
||||
| <%= link_to 'Inactive Users', users_inactive_path %>
|
||||
| <%= link_to 'Recent Activity', users_activity_path %>
|
||||
<% end %>
|
||||
<table>
|
||||
<col />
|
||||
|
||||
Reference in New Issue
Block a user