diff options
-rw-r--r-- | app/models/info_request_event.rb | 45 | ||||
-rw-r--r-- | app/views/request/_request_listing_via_event.rhtml | 6 |
2 files changed, 25 insertions, 26 deletions
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb index d16571d1a..7fab7eb14 100644 --- a/app/models/info_request_event.rb +++ b/app/models/info_request_event.rb @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request_event.rb,v 1.68 2008-11-10 11:18:39 francis Exp $ +# $Id: info_request_event.rb,v 1.69 2008-11-10 11:25:43 francis Exp $ class InfoRequestEvent < ActiveRecord::Base belongs_to :info_request @@ -196,26 +196,29 @@ class InfoRequestEvent < ActiveRecord::Base def display_status if !incoming_message.nil? status = self.calculated_state - if status == 'waiting_response' - return "Acknowledgement" - elsif status == 'waiting_clarification' - return "Clarification required" - elsif status == 'gone_postal' - return "Handled by post" - elsif status == 'not_held' - return "Information not held" - elsif status == 'rejected' - return "Rejection" - elsif status == 'partially_successful' - return "Some information sent" - elsif status == 'successful' - return "All information sent" - elsif status == 'internal_review' - return "Internal review acknowledgement" - elsif status == 'requires_admin' - return "Unusual response" + if !status.nil? + if status == 'waiting_response' + return "Acknowledgement" + elsif status == 'waiting_clarification' + return "Clarification required" + elsif status == 'gone_postal' + return "Handled by post" + elsif status == 'not_held' + return "Information not held" + elsif status == 'rejected' + return "Rejection" + elsif status == 'partially_successful' + return "Some information sent" + elsif status == 'successful' + return "All information sent" + elsif status == 'internal_review' + return "Internal review acknowledgement" + elsif status == 'requires_admin' + return "Unusual response" + end + raise "unknown status " + status end - raise "unknown status " + status + return "Response" end if !outgoing_message.nil? @@ -232,7 +235,7 @@ class InfoRequestEvent < ActiveRecord::Base return "Follow up" end - raise "display_status only works for incoming and outgoing messages right now" + raise "display_status only works for incoming and outgoing messages right now" end def is_sent_sort? diff --git a/app/views/request/_request_listing_via_event.rhtml b/app/views/request/_request_listing_via_event.rhtml index 76200f63c..d59ba1bd7 100644 --- a/app/views/request/_request_listing_via_event.rhtml +++ b/app/views/request/_request_listing_via_event.rhtml @@ -34,11 +34,7 @@ end %> by <%= user_link(info_request.user) %> on <%= simple_date(event.created_at) %>. <% elsif event.event_type == 'response' %> - <% if event.calculated_state.nil? %> - Response - <% else %> - <%=event.display_status %> - <% end %> + <%=event.display_status %> by <%= public_body_link(info_request.public_body) %> to <%= user_link(info_request.user) %> on <%= simple_date(event.created_at) %>. |