aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/request/_classify.rhtml3
-rw-r--r--app/views/request/_correspondence.rhtml23
-rw-r--r--app/views/request/_followup.rhtml38
-rw-r--r--app/views/request/show.rhtml4
-rw-r--r--app/views/request/show_response.rhtml10
-rw-r--r--app/views/request_mailer/followup.rhtml8
6 files changed, 74 insertions, 12 deletions
diff --git a/app/views/request/_classify.rhtml b/app/views/request/_classify.rhtml
index 167cb0d90..f48c53f3d 100644
--- a/app/views/request/_classify.rhtml
+++ b/app/views/request/_classify.rhtml
@@ -1,4 +1,4 @@
-<% form_for(:incoming_message, @info_request ) do |f| %>
+<% form_for(:incoming_message, @info_request) do |f| %>
<h2>Got what you wanted?</h2>
<p>Does this response contain any of the information that you requested?</p>
<p>
@@ -9,6 +9,7 @@
<label for="incoming_message_contains_information_false">No, this response does not contain any of the information.</label>
</p>
+ <%= hidden_field_tag 'submitted_classify', 1 %>
<%= submit_tag "Update" %>
<p>
diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml
index d087aa87a..8b8fbc7c9 100644
--- a/app/views/request/_correspondence.rhtml
+++ b/app/views/request/_correspondence.rhtml
@@ -7,8 +7,8 @@
<%= render :partial => 'bubble', :locals => { :body => incoming_message.get_body_for_display(@collapse_quotes) } %>
<p class="event_bubble">
- <% if incoming_message.mail.from and (not incoming_message.mail.friendly_from.include?('@')) %>
- <%= incoming_message.mail.friendly_from %> of
+ <% if !incoming_message.safe_mail_from.nil? %>
+ <%= incoming_message.safe_mail_from %> of
<% end %>
<%= public_body_link(@info_request.public_body) %>
<% if incoming_message.contains_information %>
@@ -25,21 +25,32 @@
</p>
<% elsif (correspondence.class.to_s == 'InfoRequestEvent')
info_request_event = correspondence
- if info_request_event.event_type == 'sent'
+ if info_request_event.event_type == 'sent' || info_request_event.event_type == 'followup_sent'
outgoing_message = OutgoingMessage.find(info_request_event.params[:outgoing_message_id])
%>
<%= render :partial => 'bubble', :locals => { :body => outgoing_message.get_body_for_display() } %>
<p class="event_bubble">
<%= user_link(@info_request.user) %>
-
<% if outgoing_message.message_type == 'initial_request' %>
- sent the initial request
<% if outgoing_message.status == 'sent' %>
+ sent the initial request
to <%= public_body_link(@info_request.public_body) %>
on <strong><%= simple_date(info_request_event.sent_at) %></strong>
<% elsif outgoing_message.status == 'ready' %>
- it has <strong>not yet been sent</strong>
+ wrote the initial request, but it has <strong>not yet been sent</strong>
+ <% else raise "unknown outgoing_message.status" %>
+ <% end %>
+ <% elsif outgoing_message.message_type == 'followup' %>
+ <% if outgoing_message.status == 'sent' %>
+ wrote to
+ <% if !outgoing_message.incoming_message_followup.safe_mail_from.nil? %>
+ <%= outgoing_message.incoming_message_followup.safe_mail_from %> of
+ <% end %>
+ <%= public_body_link(@info_request.public_body) %>
+ on <strong><%= simple_date(info_request_event.sent_at) %></strong>
+ <% elsif outgoing_message.status == 'ready' %>
+ wrote a follow up message, but it has <strong>not yet been sent</strong>
<% else raise "unknown outgoing_message.status" %>
<% end %>
<% else raise "unknown outgoing_message.message_type" %>
diff --git a/app/views/request/_followup.rhtml b/app/views/request/_followup.rhtml
new file mode 100644
index 000000000..ef2f566fe
--- /dev/null
+++ b/app/views/request/_followup.rhtml
@@ -0,0 +1,38 @@
+<div id="followup">
+
+<% if (correspondence.class.to_s == 'IncomingMessage')
+ incoming_message = correspondence%>
+
+ <h2>Send a follow up message
+ <% if !incoming_message.safe_mail_from.nil? %>
+ to <%= incoming_message.safe_mail_from %>
+ <% end %>
+ </h2>
+
+ <p>If the public body has asked for clarifications about your request,
+ you can respond to them here.
+
+ <% form_for(:outgoing_message, @outgoing_message) do |o| %>
+ <p>
+ <%= o.text_area :body, :rows => 10, :cols => 55 %>
+ </p>
+
+ <p>
+ <strong>Privacy warning:</strong> Your follow up message, and any response
+ to it, will also be displayed publically on this website.
+ </p>
+
+ <%= hidden_field_tag 'submitted_followup', 1 %>
+ <%= submit_tag "Send >>" %>
+ <% end %>
+
+ <p>
+ <% if not @is_owning_user %>
+ (You will be asked to sign in as <%= user_link(@info_request.user) %>)
+ <% end %>
+ </p>
+
+<% end %>
+
+</div>
+
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index dd0dbd63b..6ab31321b 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -11,8 +11,8 @@
<p id="request_status">
<% if @status == 'awaiting' %>
- Currently <strong>waiting for a response</strong> from <%= public_body_link(@info_request.public_body) %>.
- Response must be made by <strong><%= simple_date(@date_response_required_by) %></strong>.
+ Currently <strong>waiting for a response</strong> from <%= public_body_link(@info_request.public_body) %>,
+ due by <strong><%= simple_date(@date_response_required_by) %></strong>.
<% elsif @status == 'overdue' %>
Currently <strong>overdue a response</strong> from <%=
public_body_link(@info_request.public_body) %>. The
diff --git a/app/views/request/show_response.rhtml b/app/views/request/show_response.rhtml
index a7fa90e6f..98760440e 100644
--- a/app/views/request/show_response.rhtml
+++ b/app/views/request/show_response.rhtml
@@ -1,11 +1,15 @@
<% @title = "View and classify FOI response" %>
-<%= foi_error_messages_for :incoming_message %>
+<%= foi_error_messages_for :incoming_message, :outgoing_message %>
<div id="show_response_view">
-<h2>New response to your request '<%= request_link @info_request %>'</h2>
+ <h2>New response to your request '<%= request_link @info_request %>'</h2>
-<%= render :partial => 'correspondence', :locals => { :correspondence => @incoming_message } %>
+ <%= render :partial => 'correspondence', :locals => { :correspondence => @incoming_message } %>
+
+ <div id="show_response_followup">
+ <%= render :partial => 'followup', :locals => { :correspondence => @incoming_message } %>
+ </div>
</div>
<% if not @incoming_message.user_classified %>
diff --git a/app/views/request_mailer/followup.rhtml b/app/views/request_mailer/followup.rhtml
new file mode 100644
index 000000000..6de4b0397
--- /dev/null
+++ b/app/views/request_mailer/followup.rhtml
@@ -0,0 +1,8 @@
+<%= @outgoing_message.body %>
+
+--
+
+Disclaimer: This message and all responses to it are public. Any reply that you
+make will be published on the Internet.
+
+Sent using GovernmentSpy, a project of UKCOD, registered charity number 1076346.