diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss index 1623ac1..93e111e 100755 --- a/app/assets/stylesheets/scaffolds.css.scss +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -19,16 +19,6 @@ pre { font-size: 11px; } -a { - color: #000; - &:visited { - color: #666; - } - &:hover { - color: #fff; - background-color: #000; - } -} div { &.field, &.actions { diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index cb3ac44..f6d3792 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -15,31 +15,43 @@ class UsersController < ApplicationController # GET /users # GET /users.json def index - case params[:sort] - when "name" - @users = @users.sort_by(&:name) - when "cert" - @users = @users.sort_by{ |u| [-sort_by_cert(u.certifications,params[:cert].to_i),u.name] } - when "orientation" - @users = @users.sort_by{ |u| [-u.orientation.to_i,u.name] } - when "waiver" - @users = @users.sort_by{ |u| [-u.waiver.to_i,u.name] } - when "member" - @users = @users.sort_by{ |u| [-u.member_status.to_i,u.name] } - when "card" - @users = @users.sort_by{ |u| [-u.cards.count,u.name] } - when "instructor" - @users = @users.sort{ |a,b| [b.instructor.to_s,a.name] <=> [a.instructor.to_s,b.name] } - when "admin" - @users = @users.sort{ |a,b| [b.admin.to_s,a.name] <=> [a.admin.to_s,b.name] } - else - @users = @users.sort_by(&:name) - end + unless params[:full] # by default, show summary + + @users = @users.joins(:payments).where("payments.date > ?", (DateTime.now - 60.days)).uniq + + respond_to do |format| + format.html { render 'summary' } + format.json { render :json => @users } + end + + else # show full + + case params[:sort] + when "name" + @users = @users.sort_by(&:name) + when "cert" + @users = @users.sort_by{ |u| [-sort_by_cert(u.certifications,params[:cert].to_i),u.name] } + when "orientation" + @users = @users.sort_by{ |u| [-u.orientation.to_i,u.name] } + when "waiver" + @users = @users.sort_by{ |u| [-u.waiver.to_i,u.name] } + when "member" + @users = @users.sort_by{ |u| [-u.member_status.to_i,u.name] } + when "card" + @users = @users.sort_by{ |u| [-u.cards.count,u.name] } + when "instructor" + @users = @users.sort{ |a,b| [b.instructor.to_s,a.name] <=> [a.instructor.to_s,b.name] } + when "admin" + @users = @users.sort{ |a,b| [b.admin.to_s,a.name] <=> [a.admin.to_s,b.name] } + else + @users = @users.sort_by(&:name) + end - respond_to do |format| - format.html # index.html.erb - format.json { render :json => @users } + respond_to do |format| + format.html # index.html.erb + format.json { render :json => @users } + end end end diff --git a/app/models/user.rb b/app/models/user.rb index 6ff8b59..f93bc1d 100755 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,6 +1,6 @@ class User < ActiveRecord::Base include Gravtastic - gravtastic :size => 120, :default => "" + gravtastic :size => 150, :default => "" # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb new file mode 100644 index 0000000..45889df --- /dev/null +++ b/app/views/users/_user.html.erb @@ -0,0 +1,6 @@ +
There's a lot more to see here, but our records show you haven't completed the new member orientation yet. If that's incorrect, please contact a volunteer.
+<% end %> + +