diff options
-rw-r--r-- | app/models/info_request.rb | 14 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 12 | ||||
-rw-r--r-- | todo.txt | 2 |
3 files changed, 23 insertions, 5 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 8e62b04d7..346600bc6 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -19,7 +19,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.36 2008-02-13 09:32:55 francis Exp $ +# $Id: info_request.rb,v 1.37 2008-02-14 09:55:21 francis Exp $ require 'digest/sha1' @@ -238,6 +238,18 @@ public info_request_event.save! end + # The last response is the default one people might want to reply to + def get_last_response + events = self.info_request_events.find(:all, :order => "created_at") + events.reverse.each do |e| + if e.event_type == 'response' + id = e.params[:incoming_message_id].to_i + return IncomingMessage.find(id) + end + end + return nil + end + # Text from the the initial request, for use in summary display def initial_request_text if outgoing_messages.empty? # mainly for use with incomplete fixtures diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index fd2455475..4af4ef8c0 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -41,8 +41,16 @@ <% elsif @status == 'partially_successful' %> The request was <strong>partially successful</strong>. <% elsif @status == 'waiting_clarification' %> - The request is <strong>waiting clarification</strong> - by <%= user_link(@info_request.user) %>. + <% if @is_owning_user %> + <%=h @info_request.public_body.name %> is <strong>waiting for your clarification</strong>. + Please + <%= link_to "send a follow up message", show_response_url(:id => @info_request.id, :incoming_message_id => @info_request.get_last_response.id) %>. + <% else %> + The request is <strong>waiting for clarification</strong>. + If you are + <%= user_link(@info_request.user) %>, please + <%= link_to "sign in", signin_url(:r => request.request_uri) %> to send a follow up message. + <% end %> <% else %> <% raise "unknown status " + @status %> <% end %> @@ -44,8 +44,6 @@ And Tom's woes: http://foi.mysociety.org/request/8 Also: Consider removing login links from notifications of new responses -Things waiting clarification need link to help you do it. - Do something at least a bit aggressive when response is late |