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

140 lines
4.2 KiB
Plaintext
Executable File

<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> |
<a href="#zombies">Never-Logged-In Members</a>
<h2><a name="new_users"></a>New Users</h2>
<table class="table table-hover">
<tr>
<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="label label-danger">&times;</span>
<% end %></td>
<td><% if user.waiver.present? %>
<%= distance_of_time_in_words(DateTime.now, user.waiver.to_date)+" ago" %>
<% else %>
<span class="label label-danger">&times;</span>
<% end %></td>
<td><% if user.orientation.present? %>
<%= distance_of_time_in_words(DateTime.now, user.orientation.to_date)+" ago" %>
<% else %>
<span class="label label-danger">&times;</span>
<% end %></td>
<td><% if user.payments.present? %>
<%= distance_of_time_in_words(Date.today, user.payments.maximum(:date))+" ago" %>
<% else %>
<span class="label label-danger">&times;</span>
<% end %></td>
</tr>
<% end %>
<% end %>
</table>
<h2><a name="members_without_cards"></a>Basic+ Members Without Cards</h2>
<table class="table table-hover">
<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 > 90 %>
<span class="label label-danger">
<% else %>
<span class="label label-success">
<% end %>
<%= distance_of_time_in_words(Date.today, user.payments.maximum(:date))+" ago" %>
</span>
<% else %>
<span class="label label-danger">&times;</span>
<% end %></td>
<td><% if user.cards.present? %>
<span class="label label-success">&check;</span>
<% else %>
<span class="label label-danger">&times;</span>
<% end %></td>
</tr>
<% end %>
<% end %>
</table>
<h2><a name="logins"></a>Logins</h2>
<table class="table table-hover">
<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>
<% if !@user_logins.blank? %>
<% @user_logins.sort_by(&:current_sign_in_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.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>
<h2><a name="zombies"></a>Never-Logged-In Members</h2>
<em>Excluding non-members</em>
<table class="table table-hover">
<tr>
<th>Name</th>
<th>Member Level</th>
<th>Account Created</th>
<th></th>
</tr>
<% if !@zombie_members.blank? %>
<% @zombie_members.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><%= distance_of_time_in_words DateTime.now, user.created_at %> ago</td>
</tr>
<% end %>
<% end %>
</table>