diff options
-rw-r--r-- | app/controllers/application.rb | 8 | ||||
-rw-r--r-- | app/models/info_request.rb | 4 | ||||
-rw-r--r-- | app/models/track_mailer.rb | 4 | ||||
-rw-r--r-- | spec/controllers/track_controller_spec.rb | 6 | ||||
-rw-r--r-- | todo.txt | 9 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/README.txt | 2 | ||||
-rw-r--r-- | vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb | 2 |
7 files changed, 16 insertions, 19 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 4c3f6e114..ae2c8dd6f 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application.rb,v 1.49 2008-06-12 13:43:29 francis Exp $ +# $Id: application.rb,v 1.50 2008-09-12 08:26:04 francis Exp $ class ApplicationController < ActionController::Base @@ -183,11 +183,11 @@ class ApplicationController < ActionController::Base # Convert URL name for sort by order, to Xapian query def order_to_sort_by(sortby) if sortby.nil? - return [nil, true] + return [nil, nil] elsif sortby == 'newest' - return ['created_at', false] + return ['created_at', true] elsif sortby == 'described' - return ['described_at', false] # use this for some RSS + return ['described_at', true] # use this for some RSS else raise "Unknown sort order " + @sortby end diff --git a/app/models/info_request.rb b/app/models/info_request.rb index b98eb1f64..8d02aa74c 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -23,7 +23,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request.rb,v 1.137 2008-09-11 10:37:37 francis Exp $ +# $Id: info_request.rb,v 1.138 2008-09-12 08:26:04 francis Exp $ require 'digest/sha1' require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian') @@ -98,7 +98,7 @@ class InfoRequest < ActiveRecord::Base t = Time.now.usec - t secs = t / 1000000.0 STDOUT.write secs.to_s + " query " + i.to_s + "\n" - results = InfoRequest.full_search([InfoRequestEvent], query, "created_at", false, nil, 25, 1).results + results = InfoRequest.full_search([InfoRequestEvent], query, "created_at", true, nil, 25, 1).results end end diff --git a/app/models/track_mailer.rb b/app/models/track_mailer.rb index bf92655af..732217e39 100644 --- a/app/models/track_mailer.rb +++ b/app/models/track_mailer.rb @@ -4,7 +4,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_mailer.rb,v 1.12 2008-05-21 10:51:24 francis Exp $ +# $Id: track_mailer.rb,v 1.13 2008-09-12 08:26:04 francis Exp $ class TrackMailer < ApplicationMailer def event_digest(user, email_about_things) @@ -43,7 +43,7 @@ class TrackMailer < ApplicationMailer # Query for things in this track. We use described_at for the # ordering, so we catch anything new (before described), or # anything whose new status has been described. - xapian_object = InfoRequest.full_search([InfoRequestEvent], track_thing.track_query, 'described_at', false, nil, 200, 1) + xapian_object = InfoRequest.full_search([InfoRequestEvent], track_thing.track_query, 'described_at', true, nil, 200, 1) # Go through looking for unalerted things alert_results = [] diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb index ce3528812..173ffab7e 100644 --- a/spec/controllers/track_controller_spec.rb +++ b/spec/controllers/track_controller_spec.rb @@ -69,9 +69,9 @@ describe TrackController, "when viewing RSS feed for a track" do 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) + assigns[:xapian_object].results[0][:model].should == info_request_events(:silly_comment_event) # created_at 2008-08-12 23:05:12.500942 + assigns[:xapian_object].results[1][:model].should == info_request_events(:useless_incoming_message_event) # created_at 2007-11-13 18:09:20.042061 + assigns[:xapian_object].results[2][:model].should == info_request_events(:useless_outgoing_message_event) # created_at 2007-10-14 10:41:12.686264 end end @@ -2,9 +2,7 @@ Test data for Tony Check tracks still work with URL routing changes -Site move: - Install PostgresSQL 8.3 - Move database +Check foi backup Next ==== @@ -12,6 +10,7 @@ Next Write code to make sure the Return-Path is never foi@sandwich grrr Maybe move "send followup" into actions? +Maybe make it so you need to log in to send follow up (i.e. before) 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). @@ -73,15 +72,13 @@ CSS things - Spacing on error boxes round form elements - icons for "Things to do with this request" ? - favicon.ico would be nice - Wrapping of lines like this - are we taking few enough chars per line when wrapping annotations? http://www.whatdotheyknow.com/request/contract_with_thales_for_nationa#comment-95 http://www.whatdotheyknow.com/request/marketing_budget_for_id_card_sch_2#outgoing-4110 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 -Google search within website of authority. Show similar requests after you have filed yours - maybe on preview too. +Fit google search and website search better into flow somehow, but how :( Flag bad comments, delete comments from admin interface - perhaps via contact form, and form sending refering URL? diff --git a/vendor/plugins/acts_as_xapian/README.txt b/vendor/plugins/acts_as_xapian/README.txt index fdd6d5424..9b9016051 100644 --- a/vendor/plugins/acts_as_xapian/README.txt +++ b/vendor/plugins/acts_as_xapian/README.txt @@ -190,7 +190,7 @@ And then a hash of options: * :offset - Offset of first result (default 0) * :limit - Number of results per page * :sort_by_prefix - Optionally, prefix of value to sort by, otherwise sort by relevance -* :sort_by_ascending - Default true, set to false for descending sort +* :sort_by_ascending - Default true (documents with higher values better/earlier), set to false for descending sort * :collapse_by_prefix - Optionally, prefix of value to collapse by (i.e. only return most relevant result from group) Google like query syntax is as described in diff --git a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb index e74afdf1e..ce1d15f5a 100644 --- a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb +++ b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb @@ -215,7 +215,7 @@ module ActsAsXapian raise "please specifiy maximum number of results to return with parameter :limit" if not limit limit = limit.to_i sort_by_prefix = options[:sort_by_prefix] || nil - sort_by_ascending = options[:sort_by_ascending] || true + sort_by_ascending = options[:sort_by_ascending].nil? ? true : options[:sort_by_ascending] collapse_by_prefix = options[:collapse_by_prefix] || nil ActsAsXapian.enquire.query = self.query |