diff options
author | francis <francis> | 2008-04-04 01:35:44 +0000 |
---|---|---|
committer | francis <francis> | 2008-04-04 01:35:44 +0000 |
commit | fa6c0d1610ccad8c89a36411745c80b2408e0854 (patch) | |
tree | ef5480b8680794f57f47eb953a472f45c04c33b6 | |
parent | fdeeb8e49f38089f03b40e08b73f498d00ee8a31 (diff) |
Put links on user pages, yeuch
-rw-r--r-- | app/models/track_thing.rb | 10 | ||||
-rw-r--r-- | app/views/track_mailer/event_digest.rhtml | 4 | ||||
-rw-r--r-- | app/views/user/show.rhtml | 6 |
3 files changed, 15 insertions, 5 deletions
diff --git a/app/models/track_thing.rb b/app/models/track_thing.rb index 7616e4990..dc395687c 100644 --- a/app/models/track_thing.rb +++ b/app/models/track_thing.rb @@ -18,7 +18,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_thing.rb,v 1.3 2008-04-03 18:45:01 francis Exp $ +# $Id: track_thing.rb,v 1.4 2008-04-04 01:35:44 francis Exp $ class TrackThing < ActiveRecord::Base belongs_to :user, :foreign_key => 'tracking_user_id' @@ -48,15 +48,21 @@ class TrackThing < ActiveRecord::Base end # Return hash of text parameters describing the request etc. + include LinkToHelper def params if @params.nil? if self.track_type == 'request_updates' @params = { + # Website :title => "Track the request '" + CGI.escapeHTML(self.info_request.title) + "'", - :describe => "the request '" + CGI.escapeHTML(self.info_request.title) + "'", + :list_description => "'<a href=\"/request/" + CGI.escapeHTML(self.info_request.url_title) + "\">" + CGI.escapeHTML(self.info_request.title) + "</a>', a request", # XXX yeuch, sometimes I just want to call view helpers from the model, sorry! can't work out how + # Email + :title_in_email => "New updates for the request '" + self.info_request.title + "'", + # Authentication :web => "To follow updates to the request '" + CGI.escapeHTML(self.info_request.title) + "'", :email => "Then you will be emailed whenever the request '" + CGI.escapeHTML(self.info_request.title) + "' is updated.", :email_subject => "Confirm you want to follow updates to the request '" + CGI.escapeHTML(self.info_request.title) + "'", + # Other :feed_sortby => 'described', # for RSS, as newest would give a date for responses possibly days before description } else diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml index 7c08fa026..f88a23bdf 100644 --- a/app/views/track_mailer/event_digest.rhtml +++ b/app/views/track_mailer/event_digest.rhtml @@ -2,8 +2,8 @@ # Construct the main text of the mail main_text = '' for track_thing, alert_results in @email_about_things - main_text += "New events for " + track_thing.params[:describe] + "\n" - main_text += ("=" * ("New events for ".size + track_thing.params[:describe].size)) + "\n\n" + main_text += track_thing.params[:title_in_email] + "\n" + main_text += ("=" * track_thing.params[:title_in_email].size) + "\n\n" for result in alert_results.reverse if result.class.to_s == "InfoRequestEvent" event = result diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml index be89d3899..1eebaed57 100644 --- a/app/views/user/show.rhtml +++ b/app/views/user/show.rhtml @@ -29,7 +29,11 @@ <ul> <% for track_thing in @display_user.track_things %> - <li><%= track_thing.params[:describe] %></li> + <li><%= track_thing.params[:list_description] %> + <!-- + (<%= link_to "view latest updates", :controller => 'general', :action => 'search', :query => track_thing.track_query %>) + --> + </li> <% end %> </ul> <% end %> |