aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/info_request.rb9
-rw-r--r--app/views/body/show.rhtml9
-rw-r--r--app/views/request/_request_listing.rhtml16
-rw-r--r--app/views/request/list.rhtml25
-rw-r--r--app/views/user/show.rhtml13
-rw-r--r--public/stylesheets/main.css6
-rw-r--r--todo.txt5
7 files changed, 40 insertions, 43 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 31086c0f8..8eab0cb23 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -17,7 +17,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: info_request.rb,v 1.19 2008-01-02 16:04:53 francis Exp $
+# $Id: info_request.rb,v 1.20 2008-01-02 18:14:40 francis Exp $
require 'digest/sha1'
@@ -141,6 +141,13 @@ class InfoRequest < ActiveRecord::Base
info_request_event.info_request = self
info_request_event.save!
end
+
+ # Text from the the initial request, for use in summary display
+ def initial_request_text
+ excerpt = outgoing_messages[0].body
+ excerpt.sub!(/Dear .+,/, "")
+ return excerpt
+ end
end
diff --git a/app/views/body/show.rhtml b/app/views/body/show.rhtml
index e8332949b..25692bcd3 100644
--- a/app/views/body/show.rhtml
+++ b/app/views/body/show.rhtml
@@ -2,10 +2,7 @@
<h1><%=@title%></h1>
-<p>Freedom of Information requests made to this body:</p>
-<ul>
-<% for info_request in @public_body.info_requests %>
-<li><%= info_request_link(info_request) %></li>
-<% end %>
-</ul>
+<p class="subtitle">Recent Freedom of Information requests to this public body</p>
+
+<%= render :partial => 'request/request_listing', :locals => { :info_requests => @public_body.info_requests.sort { |a,b| b.created_at <=> a.created_at } } %>
diff --git a/app/views/request/_request_listing.rhtml b/app/views/request/_request_listing.rhtml
new file mode 100644
index 000000000..76dd6cb3b
--- /dev/null
+++ b/app/views/request/_request_listing.rhtml
@@ -0,0 +1,16 @@
+
+<% for info_request in info_requests %>
+ <p class="request_listing">
+ <%= request_link(info_request) %>
+ <br>
+ <%=h excerpt(info_request.initial_request_text, "", 300) %>
+ <br>
+
+ <span class="request_listing_bottomline">
+ Requested from <%= public_body_link(info_request.public_body) %>
+ by <%= user_link(info_request.user) %>
+ on <%= simple_date(info_request.created_at) %>
+ </span>
+ </p>
+<% end %>
+
diff --git a/app/views/request/list.rhtml b/app/views/request/list.rhtml
index b898e83f5..d5d9f248d 100644
--- a/app/views/request/list.rhtml
+++ b/app/views/request/list.rhtml
@@ -2,28 +2,5 @@
<h1><%=@title%></h1>
-<table id="list_requests">
- <tr>
- <th>Public body</th>
- <th>Title</th>
- <th>Requester</th>
- <th>Created</th>
-
- </tr>
-
-<% for info_request in @info_requests %>
- <tr class="<%= cycle('odd', 'even') %>">
- <td><%= public_body_link_short(info_request.public_body) %></td>
- <td><%= request_link(info_request) %></td>
- <td><%= user_link(info_request.user) %></td>
- <td><%= simple_date(info_request.created_at) %></td>
- </tr>
-<% end %>
-
-</table>
-
-<p>
-<%= will_paginate(@info_requests) %>
-</p>
-
+<%= render :partial => 'request_listing', :locals => { :info_requests => @info_requests } %>
diff --git a/app/views/user/show.rhtml b/app/views/user/show.rhtml
index 66ecc0da8..e8df205b6 100644
--- a/app/views/user/show.rhtml
+++ b/app/views/user/show.rhtml
@@ -12,15 +12,10 @@
<p>This person has made no Freedom of Information requests using this site.</p>
<% else %>
- <p>Freedom of Information requests made by this person:</p>
- <ul>
- <% for info_request in display_user.info_requests.sort { |a,b| b.created_at <=> a.created_at } %>
- <li>
- <%= info_request_link(info_request) %>
- on <%= simple_date(info_request.created_at) %>
- </li>
- <% end %>
- </ul>
+ <p>This person has made <%=pluralize(display_user.info_requests.size, "Freedom of Information request") %>
+ using this site.</p>
+
+ <%= render :partial => 'request/request_listing', :locals => { :info_requests => display_user.info_requests.sort { |a,b| b.created_at <=> a.created_at } } %>
<% end %>
<% end %>
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index aa54ada4d..4db61963d 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -241,6 +241,12 @@ table#list_requests .odd {
background-color: #dddddd;
}
+.request_listing {
+}
+.request_listing_bottomline {
+ color: #888888;
+}
+
/* /request - viewing requests */
#request_main {
diff --git a/todo.txt b/todo.txt
index 87b3f8dbe..e05b80e9f 100644
--- a/todo.txt
+++ b/todo.txt
@@ -21,6 +21,8 @@ DTI CAM one
Next
====
+Rename outgoing_message.sent_at as last_sent_at
+
Make response messages go to a mailbox as backup
Make it so if the pipe fails, exim tries again rather than sending an error to the public body.
Or so errors go to an admin somehow, at the very least.
@@ -29,9 +31,6 @@ Track bounce messages via a separate address
- just record if they are bounce, and any DSN, for now
- and say in display "automatic message"
-Formatting of emails
- - date of bounce on http://foi.mysociety.org/request/4 is wrong
-
Either rotate log files, or merge with Apache ones
Let requester send follow-ups - but to which email address???!! aargh