diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5ddb971..a9ba487 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -40,7 +40,8 @@ class UsersController < ApplicationController # Recent user activity def activity - @users = User.where(:last_sign_in_at => 1.month.ago..Date.today) + @user_logins = User.where(:last_sign_in_at => 1.month.ago..Date.today) + @new_users = User.where(:created_at => 3.months.ago..Date.today) end # GET /users/1 diff --git a/app/views/users/activity.html.erb b/app/views/users/activity.html.erb index dd2aee8..910ba04 100644 --- a/app/views/users/activity.html.erb +++ b/app/views/users/activity.html.erb @@ -1,18 +1,62 @@
Name | +Member Level | +Account Created | +Waiver | +Orientation | +Payment | ++ |
---|---|---|---|---|---|---|
<%= link_to user.name, user %> | +<%= user.member_level_string %> | +<% if user.created_at.present? %> + <%= distance_of_time_in_words(DateTime.now, user.created_at.to_date)+" ago" %> + <% else %> + × + <% end %> | +<% if user.waiver.present? %> + <%= distance_of_time_in_words(DateTime.now, user.waiver.to_date)+" ago" %> + <% else %> + × + <% end %> | +<% if user.orientation.present? %> + <%= distance_of_time_in_words(DateTime.now, user.orientation.to_date)+" ago" %> + <% else %> + × + <% end %> | +<% if user.payments.present? %> + <%= distance_of_time_in_words(Date.today, user.payments.maximum(:date))+" ago" %> + <% else %> + × + <% end %> | +
Name | Current Sign In | Last Sign In | Sign In Count | -Name | Account Created | |
---|---|---|---|---|---|---|
<%= link_to user.name, user %> | <%= distance_of_time_in_words DateTime.now, user.current_sign_in_at %> ago | <% if user.last_sign_in_at != user.current_sign_in_at %> @@ -20,9 +64,7 @@ <% end %> | <%= user.sign_in_count %> times | -<%= link_to user.name, user %> | <%= distance_of_time_in_words DateTime.now, user.created_at %> ago | -<%= link_to 'Edit', edit_user_path(user) if can? :update, user %> |