aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/request_controller.rb9
-rw-r--r--app/controllers/user_controller.rb3
-rw-r--r--app/views/request/similar.rhtml4
-rw-r--r--app/views/user/show.rhtml18
4 files changed, 23 insertions, 11 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index fe4904db7..83b6e96ef 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_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: request_controller.rb,v 1.107 2008-09-12 19:07:28 francis Exp $
+# $Id: request_controller.rb,v 1.108 2008-09-14 01:40:29 francis Exp $
class RequestController < ApplicationController
@@ -53,6 +53,12 @@ class RequestController < ApplicationController
# doing so. Google bot was going dozens of pages in, and they are slow
# pages to generate, having an impact on server load.
@no_crawl = true
+
+ if (@page > 1)
+ @page_desc = " (page " + @page.to_s + ")"
+ else
+ @page_desc = ""
+ end
end
def list
@@ -72,6 +78,7 @@ class RequestController < ApplicationController
raise "unknown request list view " + @view.to_s
end
@xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_collapse')
+ @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] } ]
end
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index 2c98bfd7d..a194b4f36 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.56 2008-09-08 16:38:32 francis Exp $
+# $Id: user_controller.rb,v 1.57 2008-09-14 01:40:29 francis Exp $
class UserController < ApplicationController
# Show page about a user
@@ -25,6 +25,7 @@ class UserController < ApplicationController
# Use search query for this so can collapse and paginate easily
@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)
+ @page_desc = " (page " + @page.to_s + ")"
# Track corresponding to this page
@track_thing = TrackThing.create_track_for_user(@display_user)
diff --git a/app/views/request/similar.rhtml b/app/views/request/similar.rhtml
index 9f31a1af1..33034d43b 100644
--- a/app/views/request/similar.rhtml
+++ b/app/views/request/similar.rhtml
@@ -1,5 +1,5 @@
-<% @title = "Requests similar to '" + h(@info_request.title) + "'" %>
-<h1><%="Requests similar to '" + request_link(@info_request) + "'"%></h1>
+<% @title = "Requests similar to '" + h(@info_request.title) + "'" + @page_desc %>
+<h1><%="Requests similar to '" + request_link(@info_request) + "'" + @page_desc %></h1>
<!-- Important terms: <%= @xapian_object.important_terms.join(" ") %> -->
diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml
index 7daa8b11d..4e756b614 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.rhtml
@@ -63,37 +63,41 @@
<% end %>
<% if @xapian_requests.results.empty? %>
- <h2>Freedom of Information requests made by <%= @is_you ? 'you' : 'this person' %></h2>
+ <h2>Freedom of Information requests made by <%= @is_you ? 'you' : 'this person' %> </h2>
<p><%= @is_you ? 'You have' : 'This person has' %>
made no Freedom of Information requests using this site.</p>
<% else %>
<h2>
<%= @is_you ? 'Your ' : "This person's " %>
- <%=pluralize(@xapian_requests.matches_estimated, "Freedom of Information request") %>
+ <%=pluralize(@display_user.info_requests.size, "Freedom of Information request") %>
+ <!-- matches_estimated <%=@xapian_requests.matches_estimated%> -->
+ <%= @page_desc %>
</h2>
<% for result in @xapian_requests.results %>
<%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
<% end %>
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_requests.matches_estimated) %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.info_requests.size) %>
<% end %>
<% if @xapian_comments.results.empty? %>
- <h2><%= @is_you ? 'Your' : 'This person\'s' %> annotations</h2>
+ <h2><%= @is_you ? 'Your' : 'This person\'s' %> annotations </h2>
<p>None made.</p>
<% else %>
<h2>
- <%= @is_you ? 'Your ' : "This person's " %>
- <%=pluralize(@xapian_comments.matches_estimated, "annotation") %>
+ <%= @is_you ? 'Your ' : "This person's " %>
+ <%=pluralize(@display_user.comments.size, "annotation") %>
+ <!-- matches_estimated <%=@xapian_comments.matches_estimated%> -->
+ <%= @page_desc %>
</h2>
<% for result in @xapian_comments.results %>
<%= render :partial => 'request/request_listing_via_event', :locals => { :event => result[:model], :info_request => result[:model].info_request } %>
<% end %>
- <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @xapian_comments.matches_estimated) %>
+ <%= will_paginate WillPaginate::Collection.new(@page, @per_page, @display_user.comments.size) %>
<% end %>
</div>