Updating final user views

This commit is contained in:
Will Bradley 2014-04-10 21:01:42 -07:00
parent bedd80d555
commit cb0f203f82
5 changed files with 27 additions and 25 deletions

View File

@ -15,6 +15,7 @@ class HomeController < ApplicationController
end end
# Fun Stats # Fun Stats
@featured_resource = Resource.where("picture_file_name IS NOT NULL").sample
@num_certs = UserCertification.count @num_certs = UserCertification.count
@recent_certs = UserCertification.where("created_at > ?", DateTime.now - 7.days).count @recent_certs = UserCertification.where("created_at > ?", DateTime.now - 7.days).count

View File

@ -3,8 +3,8 @@
<%= simple_format Setting.welcome_body %> <%= simple_format Setting.welcome_body %>
<% end %> <% end %>
<div class="col-sm-4">
<% if ((can? :read, User) && (@recent_user_names.count > 1)) then %> <% if ((can? :read, User) && (@recent_user_names.count > 1)) then %>
<div class="col-sm-4">
<h2>New People: <em>(say hi!)</em></h2> <h2>New People: <em>(say hi!)</em></h2>
<ul> <ul>
<% @recent_user_names.each do |user| %> <% @recent_user_names.each do |user| %>
@ -13,8 +13,8 @@
<% end %> <% end %>
<% end %> <% end %>
</ul> </ul>
<% end %>
</div> </div>
<% end %>
<div class="col-sm-4"> <div class="col-sm-4">
<h2>Cool Stats:</h2> <h2>Cool Stats:</h2>
@ -43,3 +43,8 @@
<% end %> <% end %>
<%= simple_format Setting.member_resources_inset %> <%= simple_format Setting.member_resources_inset %>
</div> </div>
<span class="col-sm-4">
<h3>Featured item:</h3>
<%= render @featured_resource unless @featured_resource.blank? %>
</span>

View File

@ -6,7 +6,7 @@
<h2><a name="new_users"></a>New Users</h2> <h2><a name="new_users"></a>New Users</h2>
<table> <table class="table table-hover">
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Member Level</th> <th>Member Level</th>
@ -25,22 +25,22 @@
<td><% if user.created_at.present? %> <td><% if user.created_at.present? %>
<%= distance_of_time_in_words(DateTime.now, user.created_at.to_date)+" ago" %> <%= distance_of_time_in_words(DateTime.now, user.created_at.to_date)+" ago" %>
<% else %> <% else %>
<span class="alert">&times;</span> <span class="label label-danger">&times;</span>
<% end %></td> <% end %></td>
<td><% if user.waiver.present? %> <td><% if user.waiver.present? %>
<%= distance_of_time_in_words(DateTime.now, user.waiver.to_date)+" ago" %> <%= distance_of_time_in_words(DateTime.now, user.waiver.to_date)+" ago" %>
<% else %> <% else %>
<span class="alert">&times;</span> <span class="label label-danger">&times;</span>
<% end %></td> <% end %></td>
<td><% if user.orientation.present? %> <td><% if user.orientation.present? %>
<%= distance_of_time_in_words(DateTime.now, user.orientation.to_date)+" ago" %> <%= distance_of_time_in_words(DateTime.now, user.orientation.to_date)+" ago" %>
<% else %> <% else %>
<span class="alert">&times;</span> <span class="label label-danger">&times;</span>
<% end %></td> <% end %></td>
<td><% if user.payments.present? %> <td><% if user.payments.present? %>
<%= distance_of_time_in_words(Date.today, user.payments.maximum(:date))+" ago" %> <%= distance_of_time_in_words(Date.today, user.payments.maximum(:date))+" ago" %>
<% else %> <% else %>
<span class="alert">&times;</span> <span class="label label-danger">&times;</span>
<% end %></td> <% end %></td>
</tr> </tr>
<% end %> <% end %>
@ -48,7 +48,7 @@
</table> </table>
<h2><a name="members_without_cards"></a>Basic+ Members Without Cards</h2> <h2><a name="members_without_cards"></a>Basic+ Members Without Cards</h2>
<table> <table class="table table-hover">
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Account Created</th> <th>Account Created</th>
@ -67,19 +67,19 @@
<td><% if user.payments.present? %> <td><% if user.payments.present? %>
<% last_payment = user.payments.maximum(:date) %> <% last_payment = user.payments.maximum(:date) %>
<% if Date.today-last_payment > 60 %> <% if Date.today-last_payment > 60 %>
<span class="alert"> <span class="label label-danger">
<% else %> <% else %>
<span class="notice"> <span class="label label-success">
<% end %> <% end %>
<%= distance_of_time_in_words(Date.today, user.payments.maximum(:date))+" ago" %> <%= distance_of_time_in_words(Date.today, user.payments.maximum(:date))+" ago" %>
</span> </span>
<% else %> <% else %>
<span class="alert">&times;</span> <span class="label label-danger">&times;</span>
<% end %></td> <% end %></td>
<td><% if user.cards.present? %> <td><% if user.cards.present? %>
<span class="notice">&check;</span> <span class="label label-success">&check;</span>
<% else %> <% else %>
<span class="alert">&times;</span> <span class="label label-danger">&times;</span>
<% end %></td> <% end %></td>
</tr> </tr>
<% end %> <% end %>
@ -88,7 +88,7 @@
<h2><a name="logins"></a>Logins</h2> <h2><a name="logins"></a>Logins</h2>
<table> <table class="table table-hover">
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Current Sign In</th> <th>Current Sign In</th>
@ -118,7 +118,7 @@
<h2><a name="zombies"></a>Never-Logged-In Members</h2> <h2><a name="zombies"></a>Never-Logged-In Members</h2>
<em>Excluding non-members</em> <em>Excluding non-members</em>
<table> <table class="table table-hover">
<tr> <tr>
<th>Name</th> <th>Name</th>
<th>Member Level</th> <th>Member Level</th>

View File

@ -1,6 +1,6 @@
<h1>Inactive Users</h1> <h1>Inactive Users</h1>
<table> <table class="table table-hover">
<col /> <col />
<col /> <col />
<% if current_user.admin? then %><col /><% end %> <% if current_user.admin? then %><col /><% end %>
@ -24,14 +24,12 @@
<th>Desired Level</th> <th>Desired Level</th>
<th>Last Payment</th> <th>Last Payment</th>
<th>Joined</th> <th>Joined</th>
<th></th>
<th></th>
</tr> </tr>
<% if !@users.blank? %> <% if !@users.blank? %>
<% @users.each do |user| %> <% @users.each do |user| %>
<tr<%= " class='hidden'" if user.hidden? %>> <tr<%= " class='hidden'" if user.hidden? %>>
<td><%= image_tag user.gravatar_url(:default => "http://members.heatsynclabs.org/assets/nil.png"), :class => :avatar %></td> <td><%= image_tag user.gravatar_url(:size => 25, :default => "http://members.heatsynclabs.org/assets/nil.png"), :class => :avatar %></td>
<td><%= link_to user.name, user %></td> <td><%= link_to user.name, user %></td>
<% if current_user.admin? then %><td><%= user.email %></td><% end %> <% if current_user.admin? then %><td><%= user.email %></td><% end %>
<td><% user.certifications.each do |c| %> <td><% user.certifications.each do |c| %>
@ -51,8 +49,6 @@
<% end %> <% end %>
</td> </td>
<td><%= user.created_at.to_date %></td> <td><%= user.created_at.to_date %></td>
<td><%= link_to 'Edit', edit_user_path(user) if can? :update, user %></td>
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure? WARNING: THIS DOES NOT REMOVE THE USER FROM THE DOOR SYSTEM! DISABLE THEM FIRST.', :method => :delete if can? :destroy, user %></td>
</tr> </tr>
<% end %> <% end %>
<% end %> <% end %>