diff options
-rw-r--r-- | app/models/info_request_event.rb | 10 | ||||
-rw-r--r-- | app/views/general/search.rhtml | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index 470842c3d..ae6efcf84 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request_event.rb,v 1.54 2008-08-31 12:46:52 francis Exp $ +# $Id: info_request_event.rb,v 1.55 2008-08-31 13:08:24 francis Exp $ class InfoRequestEvent < ActiveRecord::Base belongs_to :info_request @@ -69,6 +69,7 @@ class InfoRequestEvent < ActiveRecord::Base :terms => [ [ :calculated_state, 'S', "status" ], [ :requested_by, 'B', "requested_by" ], [ :requested_from, 'F', "requested_from" ], + [ :commented_by, 'C', "commented_by" ], [ :request, 'R', "request" ], [ :variety, 'V', "variety" ], [ :filetype, 'T', "filetype" ] @@ -82,6 +83,13 @@ class InfoRequestEvent < ActiveRecord::Base def requested_from self.info_request.public_body.url_name end + def commented_by + if self.event_type == 'comment' + self.comment.user.url_name + else + return '' + end + end def request self.info_request.url_title end diff --git a/app/views/general/search.rhtml b/app/views/general/search.rhtml index b276ae20a..950bb109a 100644 --- a/app/views/general/search.rhtml +++ b/app/views/general/search.rhtml @@ -93,6 +93,7 @@ <li>Type <strong>status:</strong> to select based on the status or historical status of the request, see table below. <li><strong>requested_from:home_office</strong> to restrict to requests from the <%= link_to "Home Office", show_public_body_url(:url_name => 'home_office') %>, typing the name as in the URL. <li><strong>requested_by:julian_todd</strong> to restrict to requests made by <%= link_to "Julian Todd", show_user_url(:url_name => 'julian_todd') %>, typing the name as in the URL. + <li><strong>commented_by:tony_bowden</strong> to search annotations made by <%= link_to "Tony Bowden", show_user_url(:url_name => 'tony_bowden') %>, typing the name as in the URL. <li><strong>request:</strong> to restrict to a specific request, typing the title as in the URL. <li><strong>filetype:pdf</strong> to find all responses with PDF attachments. Or try these: <%= IncomingMessage.get_all_file_extentions%>. <li>Type <strong>01/01/2008..14/01/2008</strong> to only show things that happened in the first two weeks of January. |