diff --git a/Gemfile b/Gemfile index a7ef364..8ecbde8 100644 --- a/Gemfile +++ b/Gemfile @@ -43,3 +43,4 @@ gem 'bcrypt-ruby', '~> 3.0.0' # gem 'ruby-debug' #gem "paperclip", "~> 3.0" +gem 'gravtastic' diff --git a/Gemfile.lock b/Gemfile.lock index 1161070..94abf55 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -47,6 +47,7 @@ GEM erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) + gravtastic (3.2.6) hike (1.2.1) i18n (0.6.0) journey (1.0.4) @@ -120,6 +121,7 @@ DEPENDENCIES cancan coffee-rails (~> 3.2.1) devise + gravtastic jquery-rails json rails (= 3.2.3) diff --git a/app/assets/images/nil.png b/app/assets/images/nil.png new file mode 100644 index 0000000..85e0250 Binary files /dev/null and b/app/assets/images/nil.png differ diff --git a/app/assets/javascripts/users.js.coffee b/app/assets/javascripts/users.js.coffee index c695add..fad16ce 100644 --- a/app/assets/javascripts/users.js.coffee +++ b/app/assets/javascripts/users.js.coffee @@ -3,4 +3,5 @@ # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ jQuery -> $('#user_payment_method').change -> - $('#pmt_'+$(this).value).css('display: inline') + $('.payment_instructions').hide() + $('#pmt_'+$(this).val()).show() diff --git a/app/assets/stylesheets/scaffolds.css.scss b/app/assets/stylesheets/scaffolds.css.scss index a427ef3..c56b92f 100644 --- a/app/assets/stylesheets/scaffolds.css.scss +++ b/app/assets/stylesheets/scaffolds.css.scss @@ -4,6 +4,7 @@ body { font-family: verdana, arial, helvetica, sans-serif; font-size: 13px; line-height: 18px; + margin: 0; } p, ol, ul, td { @@ -35,10 +36,23 @@ div { } } +#header { + background-color: #eee; border: 1px solid #ddd; + border-bottom-left-radius: 1em; + border-bottom-right-radius: 1em; + padding: 0.5em; +} + +#header a { + margin-right: 1em; +} + #notice { color: green; } +#content { margin: 1em; } + .field_with_errors { padding: 2px; background-color: red; diff --git a/app/assets/stylesheets/users.css.scss b/app/assets/stylesheets/users.css.scss index 921e590..d372b96 100644 --- a/app/assets/stylesheets/users.css.scss +++ b/app/assets/stylesheets/users.css.scss @@ -5,4 +5,9 @@ .iconinfo, .hoverinfo { font-size: 1.5em; } .hoverinfo { cursor: progress; } +.payment_links { background-color: #ddd; padding: 1em; border-radius: 1em; + display: inline-block; float: right; } + +.avatar { height: 2em; width: 2em; } + textarea { height: 10em; } diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb new file mode 100644 index 0000000..a893c77 --- /dev/null +++ b/app/controllers/registrations_controller.rb @@ -0,0 +1,14 @@ +class RegistrationsController < Devise::RegistrationsController + protected + + # After signup + def after_sign_up_path_for(resource) + '/users/edit/?flash=welcome_msg' + end + + # After edit + def after_update_path_for(resource) + '/users/edit' + end + +end diff --git a/app/models/ability.rb b/app/models/ability.rb index 1c4ae6d..4ed0b2d 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -17,7 +17,7 @@ class Ability # Instructors can manage certs and see users if user.instructor? can :manage, Certification - can [:create,:read], User + can [:create,:read], User, :hidden => [nil,false] can :manage, UserCertification end # Users can see others' stuff if they've been oriented diff --git a/app/models/user.rb b/app/models/user.rb index d987add..f74b7a2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,4 +1,7 @@ class User < ActiveRecord::Base + include Gravtastic + gravtastic :size => 120, :default => "" + # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable diff --git a/app/views/cards/index.html.erb b/app/views/cards/index.html.erb index 53ff18d..1e02060 100644 --- a/app/views/cards/index.html.erb +++ b/app/views/cards/index.html.erb @@ -1,4 +1,4 @@ -
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.
+Please also note that certain privileges like 24/7 card access require community approval.
+Thanks again, and happy hacking!
Have your bank send a monthly check to HeatSync Labs Treasurer, 140 W Main St, Mesa AZ 85201 Electronic or advance payments are appreciated!
+<% elsif resource.payment_method == "Check" %> +Mail to HeatSync Labs Treasurer, 140 W Main St, Mesa AZ 85201 OR put in the drop safe at the Lab with a deposit slip firmly attached each month. Electronic or advance payments are appreciated!
+<% elsif resource.payment_method == "Cash" %> +Put in the drop safe at the Lab with a deposit slip firmly attached each month. Electronic or advance payments are appreciated!
+<% else %> +Normally you'd see payment buttons here, but you don't seem to have an electronic payment option selected...
+<% end %> +You can sign up to become a member here, but you'll need to visit the lab to get full access.
+<% end %> + <% if user_signed_in? && current_user.member.to_i < current_user.member_level.to_i then %>Looks like we haven't acknowledged a recent payment for you yet. This could be because we're slow, or this app just got started, but if in doubt please see your profile for payment instructions, or consider updating your membership level to something accurate.
Thanks for supporting HeatSync!
<%= raw(notice) %>
<%= raw(alert) %>
+Name | <% if current_user.admin? then %>Certifications | @@ -32,6 +34,7 @@ <% if !@users.blank? %> <% @users.each do |user| %>||
---|---|---|---|
<%= image_tag user.gravatar_url(:default => "http://members.heatsynclabs.org/assets/nil.png"), :class => :avatar %> | <%= link_to user.name, user %> | <% if current_user.admin? then %><%= user.email %> | <% end %><% user.certifications.each do |c| %> @@ -52,4 +55,8 @@ <% end %> |
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 %> +Name: diff --git a/config/routes.rb b/config/routes.rb index 52f7666..2030948 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,7 +10,7 @@ Dooraccess::Application.routes.draw do :only => [:new, :create, :edit, :update], :path => 'users', :path_names => { :new => 'sign_up' }, - :controller => 'devise/registrations', + :controller => 'registrations', :as => :user_registration do get :cancel end