DG MS; added link to send invitation, consolidated locale file for devise invitable, upgraded devise to 1.1.3 in the gemfile

This commit is contained in:
danielvincent 2010-10-11 13:42:05 -07:00
parent 9bfb213465
commit afad554f01
10 changed files with 60 additions and 39 deletions

View file

@ -4,7 +4,7 @@ gem 'rails', '3.0.0'
gem 'bundler', '>= 1.0.0'
#Security
gem 'devise', '1.1.2'
gem 'devise', '1.1.3'
gem 'devise-mongo_mapper', :git => 'git://github.com/collectiveidea/devise-mongo_mapper'
gem 'devise_invitable', '~> 0.3.4'
#Mongo

View file

@ -49,21 +49,22 @@ GIT
GIT
remote: http://github.com/dcu/magent.git
revision: 06513f3dac812469a55f2e365c349af4d2abc92a
revision: 5d664351b305141158fc69fc495456414821adb3
specs:
magent (0.4.2)
mongo (>= 0.1.0)
uuidtools (>= 2.0.0)
magent (1.0.0)
em-websocket
mongo
uuidtools
GIT
remote: http://github.com/jnunemaker/mongomapper.git
revision: 5a3328244b641fa4f6a3743e9e0b4dd6a1ac2700
revision: fd59b0ab068be7321f8e84b9dc12fb4fa6b8535d
branch: rails3
specs:
mongo_mapper (0.8.4)
activemodel (~> 3.0.0)
activesupport (~> 3.0.0)
plucky (~> 0.3.5)
plucky (~> 0.3.6)
GEM
remote: http://rubygems.org/
@ -119,6 +120,8 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (>= 0.0.3)
childprocess (0.0.7)
ffi (~> 0.6.3)
columnize (0.3.1)
crack (0.1.8)
cucumber (0.9.2)
@ -132,7 +135,7 @@ GEM
culerity (0.2.12)
daemons (1.1.0)
database_cleaner (0.5.2)
devise (1.1.2)
devise (1.1.3)
bcrypt-ruby (~> 2.1.2)
warden (~> 0.10.7)
devise_invitable (0.3.4)
@ -173,7 +176,7 @@ GEM
subexec (~> 0.0.4)
mocha (0.9.8)
rake
mongo (1.0.9)
mongo (1.1)
bson (>= 1.0.5)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
@ -183,8 +186,8 @@ GEM
net-ssh-gateway (1.0.1)
net-ssh (>= 1.99.1)
nokogiri (1.4.3.1)
plucky (0.3.5)
mongo (~> 1.0.8)
plucky (0.3.6)
mongo (~> 1.1)
polyglot (0.3.1)
pubsubhubbub (0.1.1)
em-http-request (>= 0.1.5)
@ -210,16 +213,16 @@ GEM
rake (0.8.7)
rest-client (1.6.1)
mime-types (>= 1.16)
rspec (2.0.0.rc)
rspec-core (= 2.0.0.rc)
rspec-expectations (= 2.0.0.rc)
rspec-mocks (= 2.0.0.rc)
rspec-core (2.0.0.rc)
rspec-expectations (2.0.0.rc)
rspec (2.0.0)
rspec-core (= 2.0.0)
rspec-expectations (= 2.0.0)
rspec-mocks (= 2.0.0)
rspec-core (2.0.0)
rspec-expectations (2.0.0)
diff-lcs (>= 1.1.2)
rspec-mocks (2.0.0.rc)
rspec-core (= 2.0.0.rc)
rspec-expectations (= 2.0.0.rc)
rspec-mocks (2.0.0)
rspec-core (= 2.0.0)
rspec-expectations (= 2.0.0)
rspec-rails (2.0.0.beta.17)
rspec (>= 2.0.0.beta.14)
webrat (>= 0.7.0)
@ -229,8 +232,9 @@ GEM
ruby-debug-base (0.10.3)
linecache (>= 0.3)
rubyzip (0.9.4)
selenium-webdriver (0.0.28)
ffi (>= 0.6.1)
selenium-webdriver (0.0.29)
childprocess (>= 0.0.7)
ffi (~> 0.6.3)
json_pure
rubyzip
subexec (0.0.4)
@ -269,7 +273,7 @@ DEPENDENCIES
carrierwave!
cucumber-rails (= 0.3.2)
database_cleaner
devise (= 1.1.2)
devise (= 1.1.3)
devise-mongo_mapper!
devise_invitable (~> 0.3.4)
em-http-request!

View file

@ -4,15 +4,10 @@
class InvitationsController < Devise::InvitationsController
def update
puts params.inspect
begin
puts params["user"]["invitation_token"]
user = User.find_by_invitation_token(params["user"]["invitation_token"])
puts user.inspect
user.accept_invitation!(params["user"])
rescue MongoMapper::DocumentNotValid => e
puts "Doc Not VALID"
user = nil
flash[:error] = e.message
end

View file

@ -71,6 +71,10 @@ class UsersController < ApplicationController
send_data( File.open(tar_path).read, :filename => "#{current_user.id}.tar" )
end
def invite
User.invite!(:email => params[:email])
end
private
def prep_image_url(params)
url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/'

View file

@ -27,7 +27,7 @@
- content_for :publish do
= link_to(t('.add_a_new_aspect'), "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => t('.add_a_new_aspect'))
= link_to "invite a friend!", new_user_invitation_path
%ul#aspect_list
- for aspect in @aspects
%li.aspect

View file

@ -0,0 +1,10 @@
%h2 Send invitation
= form_for resource, :as => resource_name, :url => invitation_path(resource_name) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p= f.submit "Send an invitation"
= link_to "Home", after_sign_in_path_for(resource_name)
%br/

View file

@ -0,0 +1,9 @@
%p
Hello #{@resource.email}!
%p
Someone has invited you to #{root_url}, you can accept it through the link below.
%p= link_to 'Accept invitation', accept_invitation_url(@resource, :invitation_token => @resource.invitation_token)
%p
If you don't want to accept the invitation, please ignore this email.
%br/
Your account won't be created until you access the link above and set your password.

View file

@ -30,6 +30,10 @@ en:
unlocks:
send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
unlocked: 'Your account was successfully unlocked. You are now signed in.'
invitations:
send_instructions: 'Your invitation has been sent.'
invitation_token_invalid: 'The invitation token provided is not valid!'
updated: 'Your password was set successfully. You are now signed in.'
mailer:
confirmation_instructions:
subject: 'Confirmation instructions'
@ -37,3 +41,6 @@ en:
subject: 'Reset password instructions'
unlock_instructions:
subject: 'Unlock Instructions'
invitation:
subject: 'A friend wants you to join Diaspora!'

View file

@ -1,8 +0,0 @@
en:
devise:
invitations:
send_instructions: 'An email with instructions about how to set the password has been sent.'
updated: 'Your password was set successfully. You are now signed in.'
mailer:
invitiation:
subject: 'Invitation'

View file

@ -14,8 +14,8 @@ Diaspora::Application.routes.draw do
:password => "devise/passwords",
:invitations => "invitations"}
# added public route to user
match 'public/:username', :to => 'users#public'
match 'users/export', :to => 'users#export'
match 'public/:username', :to => 'users#public'
match 'users/export', :to => 'users#export'
match 'users/export_photos', :to => 'users#export_photos'
resources :users, :except => [:create, :new, :show]