aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--todo.txt27
5 files changed, 34 insertions, 27 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>
diff --git a/todo.txt b/todo.txt
index 4899061cf..d998df49b 100644
--- a/todo.txt
+++ b/todo.txt
@@ -4,25 +4,16 @@ Profile it!
Test data for Tony
Check tracks still work with URL routing changes
+Check new comments are arriving in variety:comment/newest search first
Check foi backup
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).
-Should make a general will_paginate like function to do this part, and call
-that from /search (which has this already) too.
-Paginate request listing (and other things!) on user page, and on public
-authority page.
-http://www.whatdotheyknow.com/user/stuart_hardwicke_carruthers
-
Internal review status/marker?
http://www.whatdotheyknow.com/request/search_engine_advertising_bought
http://www.whatdotheyknow.com/request/communications_from_home_office
@@ -47,9 +38,6 @@ Payment required
Request withdrawn by user status/marker?
-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
-
Perhaps encourage user to annotate what they learnt after getting information?
When they say "successful", encourage them to make an annotation?
@@ -81,9 +69,6 @@ Merge workflow into one stream - find information, if you can't find it then req
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?
-
Add "I have a large file" to FOI office FAQ
Add "Who should I make my request to?"
Add "I want to file squillions of requests"
@@ -101,9 +86,19 @@ Don't let somebody file a new request if they haven't classified all existing on
Test code for FOI officer upload
+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
+
+Write code to make sure the Return-Path is never foi@sandwich.org.uk (even if the
+ Rails code breaks for Sendmail case in future botched Rails upgrades :)
+
+
Later
=====
+Flag bad comments, delete comments from admin interface
+ - perhaps via contact form, and form sending refering URL?
+
Protect from CSRF with this in app controller (care it doesn't break anything):
# See ActionController::RequestForgeryProtection for details
# Uncomment the :secret if you're not using the cookie session store