aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/user_controller.rb
diff options
context:
space:
mode:
authorfrancis <francis>2009-03-18 02:37:42 +0000
committerfrancis <francis>2009-03-18 02:37:42 +0000
commita98a25420764a37474a5555ad08665fd1c84329a (patch)
treed767c1d7763cd9b6c4e4f42187e071eaa0002721 /app/controllers/user_controller.rb
parent53c2c97bd0d5e545d4dfa71865c62103d4c1c2e1 (diff)
Paginate requests list on authorities page.
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r--app/controllers/user_controller.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index 38ebd076f..5809484f1 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: user_controller.rb,v 1.63 2009-03-09 01:17:04 francis Exp $
+# $Id: user_controller.rb,v 1.64 2009-03-18 02:37:42 francis Exp $
class UserController < ApplicationController
# Show page about a user
@@ -23,21 +23,20 @@ class UserController < ApplicationController
@is_you = !@user.nil? && @user.id == @display_user.id
# Use search query for this so can collapse and paginate easily
- # XXX really should just use SQL query here rather than Xapian. Partly
- # will be more accurate, as will include backpage'd requests which
- # don't appear in Xapian.
+ # XXX really should just use SQL query here rather than Xapian.
begin
@xapian_requests = perform_search([InfoRequestEvent], 'requested_by:' + @display_user.url_name, 'newest', 'request_collapse')
@xapian_comments = perform_search([InfoRequestEvent], 'commented_by:' + @display_user.url_name, 'newest', nil)
+
+ if (@page > 1)
+ @page_desc = " (page " + @page.to_s + ")"
+ else
+ @page_desc = ""
+ end
rescue
@xapian_requests = nil
@xapian_comments = nil
end
- if (@page > 1)
- @page_desc = " (page " + @page.to_s + ")"
- else
- @page_desc = ""
- end
# Track corresponding to this page
@track_thing = TrackThing.create_track_for_user(@display_user)