diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-05-30 13:52:32 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-05-30 13:52:32 +0100 |
commit | 4387c6a45d12b9ffab398fcba28deb5669ada4f0 (patch) | |
tree | d263d4d7ca778051d80072eb50e0c72f4481d1dd /app/controllers/track_controller.rb | |
parent | fe09c8da70967ea591a3b01d7a70fc80490f3d8f (diff) | |
parent | 22d0a41bd63fca4b3b4d69018c6fa6d52010f42f (diff) |
Merge branch 'feature/follow-buttons' into develop
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r-- | app/controllers/track_controller.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 312cedc6c..07e807451 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -123,7 +123,7 @@ class TrackController < ApplicationController if @user @existing_track = TrackThing.find_by_existing_track(@user, @track_thing) if @existing_track - flash[:notice] = _("You are already being emailed updates about ") + @track_thing.params[:list_description] + flash[:notice] = _("You are already following updates about {{track_description}}", :track_description => @track_thing.params[:list_description]) return true end end @@ -135,8 +135,11 @@ class TrackController < ApplicationController @track_thing.track_medium = 'email_daily' @track_thing.tracking_user_id = @user.id @track_thing.save! - - flash[:notice] = _("You will now be emailed updates about ") + @track_thing.params[:list_description] + if @user.receive_email_alerts + flash[:notice] = _('You will now be emailed updates about {{track_description}}. <a href="{{change_email_alerts_url}}">Prefer not to receive emails?</a>', :track_description => @track_thing.params[:list_description], :change_email_alerts_url => url_for(:controller => "user", :action => "wall", :url_name => @user.url_name)) + else + flash[:notice] = _('You are now <a href="{{wall_url_user}}">following</a> updates about {{track_description}}', :track_description => @track_thing.params[:list_description], :wall_url_user => url_for(:controller => "user", :action => "wall", :url_name => @user.url_name)) + end return true end @@ -179,7 +182,7 @@ class TrackController < ApplicationController new_medium = params[:track_medium] if new_medium == 'delete' track_thing.destroy - flash[:notice] = _("You will no longer be emailed updates about ") + track_thing.params[:list_description] + flash[:notice] = _("You are no longer following {{track_description}}", :track_description => track_thing.params[:list_description]) redirect_to params[:r] # Reuse code like this if we let medium change again. #elsif new_medium == 'email_daily' |