aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-08-24 11:50:10 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-08-29 09:44:32 +0100
commit284808d259b3ba8ba1e6c106d949fffeb110a5a7 (patch)
treee71adef34ba97cec8c0fa53232f37e6d0eebb30c /app/controllers/request_controller.rb
parent50cd41b88b4421824e436d9189f8780b84c46a1a (diff)
First stab at filtering on the "View requests" page
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb26
1 files changed, 7 insertions, 19 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index c1a13273a..731348fbf 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -129,25 +129,12 @@ class RequestController < ApplicationController
def list
medium_cache
@view = params[:view]
-
- if @view.nil?
- redirect_to request_list_url(:view => 'successful')
- return
- end
-
- if @view == 'recent'
- @title = _("Recently sent Freedom of Information requests")
- query = "variety:sent";
- sortby = "newest"
- @track_thing = TrackThing.create_track_for_all_new_requests
- elsif @view == 'successful'
- @title = _("Recently successful responses")
- query = 'variety:response (status:successful OR status:partially_successful)'
- sortby = "described"
- @track_thing = TrackThing.create_track_for_all_successful_requests
- else
- raise "unknown request list view " + @view.to_s
+ if !@view.nil?
+ params[:request_status] = @view
end
+ params[:request_status] = "recent" if params[:query].nil? && params[:request_status].nil?
+ query, sortby = alter_query_from_params(params[:query])
+ @title = "Some title"
@page = get_search_page_from_params if !@page # used in cache case, as perform_search sets @page as side effect
behavior_cache :tag => [@view, @page] do
@@ -158,7 +145,8 @@ class RequestController < ApplicationController
@title = @title + " (page " + @page.to_s + ")" if (@page > 1)
- @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ]
+ # XXX need to reinstate the following; @track_thing had previously been set to "TrackThing.create_track_for_all_new_requests" and "TrackThing.create_track_for_all_successful_requests"
+ # @feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ]
# Don't let robots go more than 20 pages in
if @page > 20