diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 39f4e891f..f01aaa024 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -80,6 +80,12 @@ class InvitationsController < Devise::InvitationsController redirect_to :back end + def email + @invs = [] + @resource = User.find_by_invitation_token(params[:invitation_token]) || User.first + @resource.invitation_token = 'foobar' + render 'devise/mailer/invitation_instructions', :layout => false + end protected def check_token diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a8a31e857..7aa4eb30e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,6 +3,7 @@ # the COPYRIGHT file. module ApplicationHelper + def how_long_ago(obj) timeago(obj.created_at) end diff --git a/app/views/devise/mailer/_batch_invites.html.erb b/app/views/devise/mailer/_batch_invites.html.erb index e69de29bb..569ee73c0 100644 --- a/app/views/devise/mailer/_batch_invites.html.erb +++ b/app/views/devise/mailer/_batch_invites.html.erb @@ -0,0 +1,100 @@ +

Email not displaying correctly? View it in your browser

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Diaspora + +
+ Finally - it's here.
+ +
+ Diaspora is now in beta! +
+ Sign up now → +
+ Get Connected
+ + + + + +
+ + +An international movement with a shared vision for a better web, Diaspora's #1 feature is its community. Meet new people, connect with friends, and join the fun. +
+ +
+
+ Be Yourself
+ + + + + + +
+ +Expression is what makes the internet awesome. Because Diaspora is controlled by its users, you are free to express your identity and share in any way you want! +
+ +
+ +
+
+ Collect the Web
+ + + + + +
+ + + Be they funny or inspirational, the internet is full of wonderful images. + Cubbi.es, world's first Diaspora application, gives you a beautiful way to keep track and share your best finds with people you care about.
+ +
+
+ Click Here to Accept your invite! +
+ Diaspora is open source software, and there has never been a better time to jump in than now! +
+ Love,
+ Team Diaspora
+
+ To unsubscribe please click here. + For general inquiries or support with your Diaspora account, please email us at questions@joindiaspora.com. +
+ diff --git a/app/views/devise/mailer/_batch_invites.html.haml b/app/views/devise/mailer/_batch_invites.html.haml deleted file mode 100644 index e69de29bb..000000000 diff --git a/app/views/devise/mailer/invitation_instructions.html.haml b/app/views/devise/mailer/invitation_instructions.html.haml index 30787a802..7ad3def60 100644 --- a/app/views/devise/mailer/invitation_instructions.html.haml +++ b/app/views/devise/mailer/invitation_instructions.html.haml @@ -1,22 +1,22 @@ -if @invs.count > 0 !!! - %html - %head - %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - = render :partial => 'notifier/notifier_css' - %body - %header - = image_tag AppConfig[:pod_url] + 'images/logo_caps.png' - #container - - @invs = @resource.invitations_to_me - %p - = t('devise.mailer.welcome', :email => @resource.email) - = render :partial => 'inviters' + %html + %head + %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ + = render :partial => 'notifier/notifier_css' + %body + %header + = image_tag AppConfig[:pod_url] + 'images/logo_caps.png' + #container + - @invs = @resource.invitations_to_me + %p + = t('devise.mailer.welcome', :email => @resource.email) + = render :partial => 'inviters' - %p= link_to t('.accept'), accept_invitation_url(@resource, :invitation_token => @resource.invitation_token), :class => "large_text" - %p.small - = t('.ignore') - %br/ - = t('.no_account_till') + %p= link_to t('.accept'), accept_invitation_url(@resource, :invitation_token => @resource.invitation_token), :class => "large_text" + %p.small + = t('.ignore') + %br/ + = t('.no_account_till') -else - = render :partial => 'batch_invites' + = render :partial => 'devise/mailer/batch_invites' diff --git a/config/routes.rb b/config/routes.rb index 8a693de36..29ca5995b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -82,6 +82,7 @@ Diaspora::Application.routes.draw do :sessions => "sessions", :invitations => "invitations"} do get 'invitations/resend/:id' => 'invitations#resend', :as => 'invitation_resend' + get 'invitations/invite' => 'invitations#email', :as => 'invite_email' end get 'login' => redirect('/users/sign_in')