diff options
-rw-r--r-- | app/models/incoming_message.rb | 4 | ||||
-rw-r--r-- | app/views/track_mailer/event_digest.rhtml | 2 | ||||
-rw-r--r-- | spec/controllers/general_controller_spec.rb | 2 | ||||
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 6 | ||||
-rw-r--r-- | spec/controllers/track_controller_spec.rb | 11 | ||||
-rw-r--r-- | spec/fixtures/comments.yml | 11 | ||||
-rw-r--r-- | spec/fixtures/info_request_events.yml | 14 | ||||
-rw-r--r-- | todo.txt | 33 |
8 files changed, 63 insertions, 20 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 3f625f539..b5e461e81 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -19,7 +19,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: incoming_message.rb,v 1.129 2008-08-09 15:19:01 francis Exp $ +# $Id: incoming_message.rb,v 1.130 2008-08-15 00:50:33 francis Exp $ # TODO # Move some of the (e.g. quoting) functions here into rblib, as they feel @@ -205,7 +205,7 @@ class IncomingMessage < ActiveRecord::Base # XXX can later display some of these special emails as actual emails, # if they are public anyway. For now just be precautionary and only # put in descriptions of them in square brackets. - if info_request.public_body.is_requestable? + if self.info_request.public_body.is_requestable? text = text.gsub(self.info_request.public_body.request_email, "[" + self.info_request.public_body.short_or_long_name + " request email]") end text = text.gsub(self.info_request.incoming_email, "[FOI #" + self.info_request.id.to_s + " email]") diff --git a/app/views/track_mailer/event_digest.rhtml b/app/views/track_mailer/event_digest.rhtml index a6b4a2729..20f793c3d 100644 --- a/app/views/track_mailer/event_digest.rhtml +++ b/app/views/track_mailer/event_digest.rhtml @@ -39,6 +39,8 @@ extract = highlight_and_excerpt(event.outgoing_message.body_without_salutation, @highlight_words, 150, false) elsif not event.incoming_message.nil? extract = highlight_and_excerpt(event.incoming_message.get_text_for_indexing, @highlight_words, 150, false) + elsif not event.comment.nil? + extract = highlight_and_excerpt(event.comment.body, @highlight_words, 150, false) else extract = highlight_and_excerpt(info_request.initial_request_text, @highlight_words, 150, false) end diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index abc63c290..f0ab38f38 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -7,7 +7,7 @@ end describe GeneralController, "when searching" do integrate_views - fixtures :users, :outgoing_messages, :incoming_messages, :info_requests, :info_request_events, :public_bodies + fixtures :users, :outgoing_messages, :incoming_messages, :info_requests, :info_request_events, :public_bodies, :comments before do # XXX - what is proper way to do this only once? diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 59ce51efa..cd6183fe7 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -212,7 +212,7 @@ end describe RequestController, "when viewing an individual response" do integrate_views - fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages # all needed as integrating views + fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages, :comments # all needed as integrating views it "should show the response" do get :show_response, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message) @@ -222,7 +222,7 @@ end describe RequestController, "when classifying an individual response" do integrate_views - fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages # all needed as integrating views + fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages, :comments # all needed as integrating views it "should require login" do post :describe_state, :incoming_message => { :described_state => "rejected" }, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message), :last_info_request_event_id => info_request_events(:useless_incoming_message_event).id, :submitted_describe_state => 1 @@ -333,7 +333,7 @@ end describe RequestController, "sending unclassified new response reminder alerts" do integrate_views - fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages # all needed as integrating views + fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages, :comments # all needed as integrating views it "should send an alert" do RequestMailer.alert_new_response_reminders diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index 21b9c2e7c..ce3528812 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -58,7 +58,7 @@ end describe TrackController, "when viewing RSS feed for a track" do integrate_views - fixtures :info_requests, :outgoing_messages, :incoming_messages, :info_request_events, :users, :track_things + fixtures :info_requests, :outgoing_messages, :incoming_messages, :info_request_events, :users, :track_things, :comments, :public_bodies it "should get the RSS feed" do track_thing = track_things(:track_fancy_dog_request) @@ -67,10 +67,11 @@ describe TrackController, "when viewing RSS feed for a track" do response.should render_template('track/atom_feed') # XXX should check it is an atom.builder type being rendered, not sure how to - assigns[:xapian_object].matches_estimated.should == 2 - assigns[:xapian_object].results.size.should == 2 - assigns[:xapian_object].results[0][:model].should == info_request_events(:useless_incoming_message_event) - assigns[:xapian_object].results[1][:model].should == info_request_events(:useless_outgoing_message_event) + assigns[:xapian_object].matches_estimated.should == 3 + assigns[:xapian_object].results.size.should == 3 + assigns[:xapian_object].results[0][:model].should == info_request_events(:silly_comment_event) + assigns[:xapian_object].results[1][:model].should == info_request_events(:useless_incoming_message_event) + assigns[:xapian_object].results[2][:model].should == info_request_events(:useless_outgoing_message_event) end end diff --git a/spec/fixtures/comments.yml b/spec/fixtures/comments.yml new file mode 100644 index 000000000..ed1925bfa --- /dev/null +++ b/spec/fixtures/comments.yml @@ -0,0 +1,11 @@ +silly_comment: + visible: t + updated_at: 2008-08-13 01:25:17.486939 + body: This a the daftest comment the world has ever seen. + id: "1" + info_request_id: "101" + comment_type: request + user_id: "2" + created_at: 2008-08-13 01:25:17.486939 + + diff --git a/spec/fixtures/info_request_events.yml b/spec/fixtures/info_request_events.yml index 894e9cc7a..5e3c13083 100644 --- a/spec/fixtures/info_request_events.yml +++ b/spec/fixtures/info_request_events.yml @@ -25,3 +25,17 @@ useless_incoming_message_event: created_at: 2007-11-13 18:09:20.042061 described_state: incoming_message_id: 1 +silly_comment_event: + params_yaml: "--- \n\ + :comment_id: 1\n" + incoming_message_id: + last_described_at: + described_state: + id: "903" + info_request_id: "101" + comment_id: "1" + calculated_state: + event_type: comment + outgoing_message_id: + created_at: 2008-08-12 23:05:12.500942 + @@ -6,7 +6,20 @@ Site move: Next ==== -Compress the emails in the database +Sort my requests by when activity last happened to them? +http://www.whatdotheyknow.com/user/francis_irving + +Grrr - so here I wanted to clarify my request, but don't want the timer to be reset! +http://www.whatdotheyknow.com/request/online_petitions_documents_from#incoming-3248 + +Hide quoted sections shouldn't put ? at end of URL, as then link to this refreshes +http://www.whatdotheyknow.com/request/rspb_and_defra?#incoming-3104 + +Check where it sends messages to - why didn't thanks go direc to Mitchell, Marilyn? +http://www.whatdotheyknow.com/request/forthcoming_tidal_and_flood_defe#incoming-3202 + +.zip file extensions +http://www.whatdotheyknow.com/request/open_source_schools_tender Green box when you are classifying request is a bit too big / prominent Solicit people to tell us requests are misclassified? @@ -25,11 +38,11 @@ http://www.whatdotheyknow.com/request/4/response/866#show_response_followup Email subjects badly escaped Subject: Confirm you want to be emailed about requests to 'HM Revenue & Customs' -Comments interleaved with body - grep -rin followup_sent . +Don't unnecessarily show email me twice if only request hits +e.g. http://www.whatdotheyknow.com/search/phorm - - Add it to the spec fixtures - - Add basic tests +Comments interleaved with body + - Add basic tests for comment controller - Test email alerts for comments - Email people subscribed to people about new comments that they make @@ -125,6 +138,8 @@ Maybe set it up to email team@ website errors? Renaming public authorities will break alerts on them. +Compress the emails in the database + Display current page (when not on first page), or perhaps range on both the /list pages, and on the /..../similar pages (maybe I missed it elsewhere too). Should make a general will_paginate like function to do this part, and call @@ -139,10 +154,6 @@ And maybe edits to prominence, which is more upsetting Never updates cached attachment text unless cache is explicitly cleared (which might matter with software updates, or code changes) -Link more clearly to full request and next/previous correspondence (ask Matthew) - Perhaps always redirect to internal # links from the /response/ pages -e.g. http://www.flickr.com/groups/central/discuss/72157604494352123/72157604515433851/ - Get Atom highlighting to include stylesheet for yellow somehow Offer option of one RSS feed with all things you are tracking in it. Maybe. @@ -229,6 +240,10 @@ vexatious requests. Merge workflow into one stream - find information, if you can't find it then request it. so just search is on front page, with popular stuff below a la Google Directory +Shamefully your incremental search, make it as nice as Matthew's i.e. + - have actual space in layout for full list rather than pop down. + - show things beginning with the term first, separated visually + - highlight the parts which match Google search within website of authority. Show similar requests after you have filed yours - maybe on preview too. Use spelling correction for public bodies search (in addition to substring?) |