diff --git a/app/assets/stylesheets/users.css.scss b/app/assets/stylesheets/users.css.scss
index 170c27d..c3c5ffa 100644
--- a/app/assets/stylesheets/users.css.scss
+++ b/app/assets/stylesheets/users.css.scss
@@ -8,6 +8,10 @@
.payment_links { background-color: #ddd; padding: 1em; border-radius: 1em;
display: inline-block; float: right; }
+.payment-highlighted {
+ background-color: orange !important;
+}
+
.avatar { height: 2em; width: 2em; }
.avatar-large {
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 4b6877c..5ddb971 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -33,9 +33,15 @@ class UsersController < ApplicationController
end
end
+ # 'Active' users who haven't paid recently
def inactive
@users = @users.all.select{|u| u if u.payment_status == false }.sort_by{ |u| -u.delinquency }
end
+
+ # Recent user activity
+ def activity
+ @users = User.where(:last_sign_in_at => 1.month.ago..Date.today)
+ end
# GET /users/1
# GET /users/1.json
diff --git a/app/views/devise/registrations/_user.html.erb b/app/views/devise/registrations/_user.html.erb
index 26e83f2..be950b3 100644
--- a/app/views/devise/registrations/_user.html.erb
+++ b/app/views/devise/registrations/_user.html.erb
@@ -1,12 +1,21 @@
<% if params[:flash] == "welcome_msg" then %>
Thank for you choosing to become a HeatSync Labs member! As we foster this community of learning, science, and the arts every member is important.
-You can get your payments started by following the instructions on this page. Please note electronic recurring payments are -highly- encouraged-- we do not have staff. If you must pay via cash/check, please consider prepaying for 3, 6 or 12 months up front.
-To claim member benefits such as storage, grab a volunteer during your next stop into HeatSync or schedule a time to meet up in advance. Someone should also be contacting you shortly via the email address you provided.
+You can get your payments started by clicking the payment button on this page or contacting a HeatSync member. Please note electronic recurring payments are -highly- encouraged-- we do not have paid staff. If you must pay via cash/check, please consider prepaying for 3, 6 or 12 months up front to reduce volunteer workload.
+To claim member benefits such as storage, grab a volunteer during your next stop into HeatSync or schedule a time to meet up in advance. Someone should also be contacting you shortly via the email address you provided to schedule a New Member Orientation as well. After the orientation, you'll be equipped to be an awesome member of our community, and this website will get a lot more useful.
Please also note that certain privileges like 24/7 card access require community approval.
Thanks again, and happy hacking!
<% end %>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => html) do |f| %>
+
+ <%= f.label :member_level, "Membership Level" %>
+ <%= f.select :member_level, [[nil],["None",0],["Unable",1],["Volunteer",10],["Associate ($25)",25],["Basic ($50)",50],["Plus ($100)",100]] %>
+
+
+
+ <%= render :partial => "/users/payment_methods", :locals => { :g => f } %>
+
+
<%= f.label :name, "Full Name" %>
<%= f.text_field :name %>
@@ -15,12 +24,28 @@ Thanks again, and happy hacking!
<%= f.label :email %>
<%= f.email_field :email %>
+ <%= f.check_box :email_visible %>
+ <%= f.label :email_visible, "Show Email to All Members?" %>
<%= f.label :phone %>
<%= f.text_field :phone %>
+ <%= f.check_box :phone_visible %>
+ <%= f.label :phone_visible, "Show Phone to All Members?" %>
+
+
+ <%= f.label :twitter_url %>
+ <%= f.text_field :twitter_url, :placeholder => "https://twitter.com/heatsynclabs" %>
+ <%= f.label :facebook_url %>
+ <%= f.text_field :facebook_url, :placeholder => "https://www.facebook.com/HeatSyncLabs" %>
+ <%= f.label :github_url %>
+ <%= f.text_field :github_url, :placeholder => "https://github.com/heatsynclabs" %>
+ <%= f.label :website_url %>
+ <%= f.text_field :website_url, :placeholder => "http://www.heatsynclabs.org" %>
+
+
<%= f.label :emergency_name, "Emergency Contact Name" %>
<%= f.text_field :emergency_name %>
@@ -33,13 +58,6 @@ Thanks again, and happy hacking!
<%= f.label :emergency_email %>
<%= f.text_field :emergency_email %>
-
- <%= f.label :member_level, "Membership Level" %>
- <%= f.select :member_level, [[nil],["None",0],["Unable",1],["Volunteer",10],["Associate ($25)",25],["Basic ($50)",50],["Plus ($100)",100]] %>
-
-
- <%= render :partial => "/users/payment_methods", :locals => { :g => f } %>
-
<%= f.label :current_skills, "What skills, knowledge and experience do you bring to the community?" %>
<%= f.text_area :current_skills %>
diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb
index aca11bf..2d37f25 100644
--- a/app/views/devise/registrations/edit.html.erb
+++ b/app/views/devise/registrations/edit.html.erb
@@ -2,12 +2,12 @@
<%= devise_error_messages! %>
-
+
">
<% if can? :read, resource.payments then %>
Recorded Payments:
- <% resource.payments.each do |payment| %>
+ <% resource.payments.sort_by(&:date).reverse!.each do |payment| %>
- <%= payment.date %>
<% end %>
diff --git a/app/views/users/activity.html.erb b/app/views/users/activity.html.erb
new file mode 100644
index 0000000..dd2aee8
--- /dev/null
+++ b/app/views/users/activity.html.erb
@@ -0,0 +1,30 @@
+
Recent User Activity
+
+
+
+ Current Sign In |
+ Last Sign In |
+ Sign In Count |
+ Name |
+ Account Created |
+ |
+
+
+<% if !@users.blank? %>
+ <% @users.sort_by(&:current_sign_in_at).reverse!.each do |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 %>
+ <%= distance_of_time_in_words DateTime.now, user.last_sign_in_at %> ago
+ <% 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 %> |
+
+ <% end %>
+<% end %>
+
+
diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb
index bcbff58..e49a361 100644
--- a/app/views/users/index.html.erb
+++ b/app/views/users/index.html.erb
@@ -8,6 +8,7 @@
<% end %>
<% if current_user.admin? %>
| <%= link_to 'Inactive Users', users_inactive_path %>
+ | <%= link_to 'Recent Activity', users_activity_path %>
<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 46ceb98..5f0355f 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -26,6 +26,7 @@ Dooraccess::Application.routes.draw do
end
match 'user_summary/:id' => 'users#user_summary' # User summary view
+ match 'users/activity' => 'users#activity' # User activity
match 'users/merge' => 'users#merge_view', :via => :get # Merge view
match 'users/merge' => 'users#merge_action', :via => :post # Merge action
match 'users/inactive' => 'users#inactive' # Inactive users report