diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 80dc7bf..cf415b6 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -20,6 +20,10 @@ class InvitationsController < ApplicationController "address is valid." end - return redirect_to "/settings" + if params[:return_home] + return redirect_to "/" + else + return redirect_to "/settings" + end end end diff --git a/app/controllers/signup_controller.rb b/app/controllers/signup_controller.rb index f14dba3..889789c 100644 --- a/app/controllers/signup_controller.rb +++ b/app/controllers/signup_controller.rb @@ -45,7 +45,7 @@ class SignupController < ApplicationController Countinual.count!("lobsters.users.created", "+1") - return redirect_to "/" + return redirect_to "/users/invite" else render :action => "invited" end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e23f865..58dc5a5 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1,4 +1,6 @@ class UsersController < ApplicationController + before_filter :require_logged_in_user, :only => :invite + def show @showing_user = User.find_by_username!(params[:id]) @title = "User #{@showing_user.username}" @@ -34,4 +36,8 @@ class UsersController < ApplicationController @tree end + + def invite + @title = "Pass Along an Invitation" + end end diff --git a/app/views/settings/index.html.erb b/app/views/settings/index.html.erb index a0c8b50..91197fc 100644 --- a/app/views/settings/index.html.erb +++ b/app/views/settings/index.html.erb @@ -138,28 +138,5 @@ Invite a New User - <%= form_tag "/invitations", :method => :post do |f| %> -
- Invitations are used as a spam-control mechanism and are unlimited. - Persons you invite will be associated with your account in the user tree and you may be responsible for them if they cause - problems. Please use your discretion when inviting persons you don't - personally know. -
- -+Invitations are unlimited, but persons you invite will be associated with your +account in the user tree and you may be responsible for them +if they cause problems. Please use your discretion when inviting persons you +don't personally know. +
+ +<%= form_tag "/invitations", :method => :post do |f| %> + <% if defined?(return_home) && return_home %> + <%= hidden_field_tag :return_home, 1 %> + <% end %> + ++ This community can only grow when members invite new users, just as <%= + @user.invited_by_user.try(:username) %> invited you. Take a moment and + invite someone you know. +
+ + <%= render :partial => "users/invitationform", + :locals => { :return_home => true } %> + + or + ++ <%= button_to "Skip", "/" %> +
+