Open-Source-Access-Control-.../app/views/users/activity.html.erb

117 lines
3.4 KiB
Plaintext
Raw Normal View History

<h1>Member Onboarding/Activity</h1>
<a href="#new_users">New Users</a> |
<a href="#members_without_cards">Members Without Cards</a> |
<a href="#logins">Logins</a>
<h2><a name="new_users"></a>New Users</h2>
<table>
<tr>
2013-08-29 09:50:05 +00:00
<th>Name</th>
<th>Member Level</th>
<th>Account Created</th>
<th>Waiver</th>
<th>Orientation</th>
<th>Payment</th>
<th></th>
</tr>
<% if !@new_users.blank? %>
<% @new_users.sort_by(&:created_at).reverse!.each do |user| %>
<tr<%= " class='hidden'" if user.hidden? %>>
<td><%= link_to user.name, user %></td>
<td><%= user.member_level_string %></td>
<td><% if user.created_at.present? %>
<%= distance_of_time_in_words(DateTime.now, user.created_at.to_date)+" ago" %>
<% else %>
<span class="alert">&times;</span>
<% end %></td>
<td><% if user.waiver.present? %>
<%= distance_of_time_in_words(DateTime.now, user.waiver.to_date)+" ago" %>
<% else %>
<span class="alert">&times;</span>
<% end %></td>
<td><% if user.orientation.present? %>
<%= distance_of_time_in_words(DateTime.now, user.orientation.to_date)+" ago" %>
<% else %>
<span class="alert">&times;</span>
<% end %></td>
<td><% if user.payments.present? %>
<%= distance_of_time_in_words(Date.today, user.payments.maximum(:date))+" ago" %>
<% else %>
<span class="alert">&times;</span>
<% end %></td>
</tr>
<% end %>
<% end %>
</table>
<h2><a name="members_without_cards"></a>Basic+ Members Without Cards</h2>
<table>
<tr>
<th>Name</th>
<th>Account Created</th>
<th>Member Level</th>
<th>Payment</th>
<th>Card</th>
<th></th>
</tr>
<% if !@cardless_users.blank? %>
<% @cardless_users.sort_by(&:created_at).reverse!.each do |user| %>
<tr<%= " class='hidden'" if user.hidden? %>>
<td><%= link_to user.name, user %></td>
<td><%= distance_of_time_in_words DateTime.now, user.created_at %> ago</td>
<td><%= user.member_level_string %></td>
<td><% if user.payments.present? %>
<% last_payment = user.payments.maximum(:date) %>
<% if Date.today-last_payment > 60 %>
<span class="alert">
<% else %>
<span class="notice">
<% end %>
<%= distance_of_time_in_words(Date.today, user.payments.maximum(:date))+" ago" %>
</span>
<% else %>
<span class="alert">&times;</span>
<% end %></td>
<td><% if user.cards.present? %>
<span class="notice">&check;</span>
<% else %>
<span class="alert">&times;</span>
<% end %></td>
</tr>
<% end %>
<% end %>
</table>
<h2><a name="logins"></a>Logins</h2>
2013-08-29 09:50:05 +00:00
<table>
<tr>
<th>Name</th>
<th>Current Sign In</th>
<th>Last Sign In</th>
<th>Sign In Count</th>
<th>Account Created</th>
<th></th>
</tr>
2013-08-29 09:50:05 +00:00
<% if !@user_logins.blank? %>
<% @user_logins.sort_by(&:current_sign_in_at).reverse!.each do |user| %>
<tr<%= " class='hidden'" if user.hidden? %>>
2013-08-29 09:50:05 +00:00
<td><%= link_to user.name, user %></td>
<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><%= distance_of_time_in_words DateTime.now, user.created_at %> ago</td>
</tr>
<% end %>
<% end %>
</table>