From 903d920cbc273262e9975ea1d618b565d005ca27 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 17 Mar 2014 17:23:00 +0000 Subject: Remove old unused code. --- app/controllers/track_controller.rb | 8 -------- 1 file changed, 8 deletions(-) (limited to 'app/controllers/track_controller.rb') diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 83e05ebbc..2b0742a34 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -185,14 +185,6 @@ class TrackController < ApplicationController track_thing.destroy flash[:notice] = _("You are no longer following {{track_description}}.", :track_description => track_thing.params[:list_description]) redirect_to URI.parse(params[:r]).path - - # Reuse code like this if we let medium change again. - #elsif new_medium == 'email_daily' - # track_thing.track_medium = new_medium - # track_thing.created_at = Time.now() # as created_at is used to limit the alerts to start with - # track_thing.save! - # flash[:notice] = "You are now tracking " + track_thing.params[:list_description] + " by email daily" - # redirect_to user_url(track_thing.tracking_user) else raise "new medium not handled " + new_medium end -- cgit v1.2.3 From 911f559544314d96547694496e0534ced85c544e Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 17 Mar 2014 17:24:36 +0000 Subject: Remove obsolete line. Should have been removed in https://github.com/mysociety/alaveteli/commit/b236d4f113187b0e5d87867fc6512e5486f9764f. --- app/controllers/track_controller.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'app/controllers/track_controller.rb') diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 2b0742a34..103121689 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -209,7 +209,6 @@ class TrackController < ApplicationController for track_thing in TrackThing.find(:all, :conditions => [ "track_type = ? and tracking_user_id = ?", track_type, user_id ]) track_thing.destroy end - flash[:notice] += "" redirect_to params[:r] end -- cgit v1.2.3 From aec70771b7029f8c312e779a6e7fa6d5537abbed Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 17 Mar 2014 17:26:49 +0000 Subject: Add notices for subscribing something you're subscribed to. These notices are full sentences, rather than being composed of phrases, which should make them easier to translate. --- app/controllers/track_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/track_controller.rb') diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 103121689..a3a1ec42c 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -118,7 +118,7 @@ class TrackController < ApplicationController if @user @existing_track = TrackThing.find_existing(@user, @track_thing) if @existing_track - flash[:notice] = _("You are already following updates about {{track_description}}", :track_description => @track_thing.params[:list_description]) + flash[:notice] = view_context.already_subscribed_notice(@track_thing) return true end end -- cgit v1.2.3 From a00067262fd7171a39e74a4ebcd75a5758e12ee6 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 17 Mar 2014 17:30:34 +0000 Subject: Add notices for subscribing to something. These notices are complete sentences, not composed on the fly, so should be easier to translate. --- app/controllers/track_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'app/controllers/track_controller.rb') diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index a3a1ec42c..c861971bd 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -130,11 +130,7 @@ class TrackController < ApplicationController @track_thing.track_medium = 'email_daily' @track_thing.tracking_user_id = @user.id @track_thing.save! - if @user.receive_email_alerts - flash[:notice] = _('You will now be emailed updates about {{track_description}}. Prefer not to receive emails?', :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 following 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 + flash[:notice] = render_to_string(:partial => 'track_set').html_safe return true end -- cgit v1.2.3 From 5cb467c469d9a34336da483e47b931c9dd5b9078 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Mon, 17 Mar 2014 17:32:02 +0000 Subject: Add notices for unsubscribing from things. These are full sentences, not composed on the fly, so should be easier to translate. --- app/controllers/track_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/track_controller.rb') diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index c861971bd..dccc52efc 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -179,7 +179,7 @@ class TrackController < ApplicationController new_medium = params[:track_medium] if new_medium == 'delete' track_thing.destroy - flash[:notice] = _("You are no longer following {{track_description}}.", :track_description => track_thing.params[:list_description]) + flash[:notice] = view_context.unsubscribe_notice(track_thing) redirect_to URI.parse(params[:r]).path else raise "new medium not handled " + new_medium -- cgit v1.2.3