aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-04-18 02:06:33 +0000
committerfrancis <francis>2008-04-18 02:06:33 +0000
commit639e4ca5f34daf6d436ddb30f543261a3bfdcfdc (patch)
tree5224b06b02963e843bf54c20e3787ee8a0198fa2
parent316aef982e34fa914a1cbd852c10b700dcf20559 (diff)
Nasty looking but working "more" link
-rw-r--r--app/controllers/request_controller.rb10
-rw-r--r--app/views/request/show.rhtml7
-rw-r--r--todo.txt2
3 files changed, 12 insertions, 7 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index e14d3ae27..4876abcb1 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.73 2008-04-09 01:32:52 francis Exp $
+# $Id: request_controller.rb,v 1.74 2008-04-18 02:06:33 francis Exp $
class RequestController < ApplicationController
@@ -31,9 +31,15 @@ class RequestController < ApplicationController
@new_responses_count = @events_needing_description.select {|i| i.event_type == 'response'}.size
# Sidebar stuff
+ limit = 8
@info_requests_same_user_same_body = InfoRequest.find(:all, :order => "created_at desc",
:conditions => ["prominence = 'normal' and user_id = ? and public_body_id = ? and id <> ?", @info_request.user_id, @info_request.public_body_id, @info_request.id],
- :limit => 5)
+ :limit => limit)
+ @info_requests_same_user_same_body_more = false
+ if @info_requests_same_user_same_body.size == limit
+ @info_requests_same_user_same_body = @info_requests_same_user_same_body[0, limit - 1]
+ @info_requests_same_user_same_body_more = true
+ end
# Already tracking?
@track_thing = TrackThing.create_track_for_request(@info_request)
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index c1c754a3a..35ec1a258 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -99,10 +99,11 @@
<% if @info_requests_same_user_same_body.size > 0 %>
<h2>Requests from same user to same authority</h2>
- <!-- <h2>Some other requests made by
- <%= user_link(@info_request.user) %> to <%= public_body_link(@info_request.public_body) %></h2> -->
+ <!-- <h2>Some other requests made by <%= user_link(@info_request.user) %> to <%= public_body_link(@info_request.public_body) %></h2> -->
<%= render :partial => 'sidebar_request_listing', :locals => { :info_requests => @info_requests_same_user_same_body } %>
- <!-- XXX more link -->
+ <% if @info_requests_same_user_same_body_more %>
+ <p><%= link_to "More such requests", search_url(:query => "variety:sent requested_from:" + @info_request.public_body.url_name + " requested_by:" + @info_request.user.url_name + " -request:" + @info_request.url_title, :sortby => "newest") %></p>
+ <% end %>
<% end %>
<!--<h2>Juicy stuff will be here</h2>
diff --git a/todo.txt b/todo.txt
index d8cda211b..99029d8c6 100644
--- a/todo.txt
+++ b/todo.txt
@@ -28,8 +28,6 @@ BAILII - relationship with law courts, robots.txt ?
Next
====
-"Some other requests..." should have "more" link now
-
Things to track:
- new requests
- new requests with keyword