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/helpers/track_helper.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 app/helpers/track_helper.rb (limited to 'app/helpers/track_helper.rb') diff --git a/app/helpers/track_helper.rb b/app/helpers/track_helper.rb new file mode 100644 index 000000000..e2615a33f --- /dev/null +++ b/app/helpers/track_helper.rb @@ -0,0 +1,26 @@ +module TrackHelper + + def already_subscribed_notice(track_thing) + case track_thing.track_type + when 'request_updates' + _("You are already subscribed to '{{link_to_request}}', a request", + :link_to_request => request_link(track_thing.info_request)) + when 'all_new_requests' + _('You are already subscribed to any new requests', + :new_requests_url => request_list_path) + when 'all_successful_requests' + _('You are already subscribed to any successful requests', + :successful_requests_url => request_list_successful_path ) + when 'public_body_updates' + _("You are already subscribed to '{{link_to_authority}}', a public authority", + :link_to_authority => public_body_link(track_thing.public_body)) + when 'user_updates' + _("You are already subscribed to '{{link_to_user}}', a person", + :link_to_user => user_link(track_thing.tracked_user)) + when 'search_query' + _('You are already subscribed to this search', + :search_url => search_path([track_thing.track_query, 'newest', 'advanced'])) + end + end + +end -- cgit v1.2.3