aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/admin_request/show.rhtml5
-rw-r--r--app/views/request/_classify.rhtml22
-rw-r--r--app/views/request/_correspondence.rhtml9
-rw-r--r--app/views/request/_describe_state.rhtml36
-rw-r--r--app/views/request/_followup.rhtml4
-rw-r--r--app/views/request/_request_listing.rhtml24
-rw-r--r--app/views/request/describe_state.rhtml23
-rw-r--r--app/views/request/show.rhtml38
-rw-r--r--app/views/request/show_response.rhtml18
9 files changed, 131 insertions, 48 deletions
diff --git a/app/views/admin_request/show.rhtml b/app/views/admin_request/show.rhtml
index 394634470..1dd82dc6e 100644
--- a/app/views/admin_request/show.rhtml
+++ b/app/views/admin_request/show.rhtml
@@ -10,6 +10,7 @@
<strong>Public body:</strong> <%=h @info_request.public_body.name %> <br>
<strong>Incoming email address:</strong> <%=h @info_request.incoming_email %> <br>
<strong>Envelope email address:</strong> <%=h @info_request.envelope_email %> <br>
+<strong>Described last incoming message id:</strong> <%=h @info_request.described_last_incoming_message_id.nil? ? "nil" : @info_request.described_last_incoming_message_id %>
</p>
<%= link_to 'Public page', main_url(request_url(@info_request)) %>
@@ -18,6 +19,7 @@
<table>
<tr>
+ <th>Id</th>
<% for column in OutgoingMessage.content_columns %>
<th><%= column.human_name %></th>
<% end %>
@@ -26,6 +28,7 @@
<% for outgoing_message in @info_request.outgoing_messages %>
<tr class="<%= cycle('odd', 'even') %>">
+ <td><%=h outgoing_message.id %></td>
<% for column in OutgoingMessage.content_columns.map { |c| c.name } %>
<td><%=h outgoing_message.send(column) %></td>
<% end %>
@@ -44,6 +47,7 @@
<table>
<tr>
+ <th>Id</th>
<% for column in IncomingMessage.content_columns %>
<th><%= column.human_name %></th>
<% end %>
@@ -51,6 +55,7 @@
<% for incoming_message in @info_request.incoming_messages %>
<tr class="<%= cycle('odd', 'even') %>">
+ <td><%=h incoming_message.id %></td>
<% for column in IncomingMessage.content_columns.map { |c| c.name } %>
<td><%=h incoming_message.send(column) %></td>
<% end %>
diff --git a/app/views/request/_classify.rhtml b/app/views/request/_classify.rhtml
deleted file mode 100644
index f48c53f3d..000000000
--- a/app/views/request/_classify.rhtml
+++ /dev/null
@@ -1,22 +0,0 @@
-<% 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>
- <%= radio_button "incoming_message", "contains_information", "true" %>
- <label for="incoming_message_contains_information_true">Yes, this response contains some or all of the information that I requested.</label>
- <br>
- <%= radio_button "incoming_message", "contains_information", "false" %>
- <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>
- <% if not @is_owning_user %>
- (You will be asked to sign in as <%= user_link(@info_request.user) %>)
- <% end %>
- </p>
-
-<% end %>
-
diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml
index 2f64d1246..6758bb189 100644
--- a/app/views/request/_correspondence.rhtml
+++ b/app/views/request/_correspondence.rhtml
@@ -11,17 +11,14 @@
<%= incoming_message.safe_mail_from %> of
<% end %>
<%= public_body_link(@info_request.public_body) %>
- <% if incoming_message.contains_information %>
- sent some <strong>useful information</strong>
- <% elsif incoming_message.is_bounce %>
+ <% if incoming_message.is_bounce %>
replied automatically
<% else %>
replied
<% end %>
on <strong><%= simple_date(incoming_message.sent_at) %></strong>
- <% if not incoming_message.user_classified %>
- &mdash; please <%= link_to "classify this response", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) %>
- <% end %>
+ (<%= link_to "link to this", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) %>,
+ <%= link_to "reply", show_response_url(:id => incoming_message.info_request.id, :incoming_message_id => incoming_message.id) + "#show_response_followup" %>)
</p>
<% elsif (correspondence.class.to_s == 'InfoRequestEvent')
info_request_event = correspondence
diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml
new file mode 100644
index 000000000..22336972f
--- /dev/null
+++ b/app/views/request/_describe_state.rhtml
@@ -0,0 +1,36 @@
+<% if @is_owning_user %>
+ <% form_for(:incoming_message, @info_request, :url => describe_state_url(:id => @info_request.id)) do |f| %>
+ <h2>What are you doing about this request now?</h2>
+ <p>Filling this in each time you get a new response helps us track the progress of your request.
+ </p>
+ <p>
+ <%= radio_button "incoming_message", "described_state", "waiting_response" %>
+ <label for="incoming_message_described_state_waiting_response">I'm still <strong>waiting</strong> for a response</label>
+ <br>
+ <%= radio_button "incoming_message", "described_state", "waiting_clarification" %>
+ <label for="incoming_message_described_state_waiting_clarification">I'm about to <strong>clarify</strong> my request</label>
+ <br>
+ <%= radio_button "incoming_message", "described_state", "rejected" %>
+ <label for="incoming_message_described_state_rejected">My request has been <strong>rejected</strong></label>
+ <br>
+ <%= radio_button "incoming_message", "described_state", "successful" %>
+ <label for="incoming_message_described_state_successful">I've received (nearly) <strong>all the information</strong> that I asked for</label>
+ <br>
+ <%= radio_button "incoming_message", "described_state", "partially_successful" %>
+ <label for="incoming_message_described_state_partially_successful">I've received <strong>some of the information</strong> that I asked for</label>
+ </p>
+
+ <%= hidden_field_tag 'submitted_describe_state', 1 %>
+ <%= submit_tag "Next >>" %>
+ <% end %>
+<% else %>
+ We don't know whether the most recent response to this request contains
+ information or not
+ &ndash;
+ if you are
+ <%= user_link(@info_request.user) %>,
+ please
+ <%= link_to "sign in", signin_url(:r => request.request_uri) %>
+ and let everyone know.
+<% end %>
+
diff --git a/app/views/request/_followup.rhtml b/app/views/request/_followup.rhtml
index ef2f566fe..f228ca71d 100644
--- a/app/views/request/_followup.rhtml
+++ b/app/views/request/_followup.rhtml
@@ -9,8 +9,8 @@
<% end %>
</h2>
- <p>If the public body has asked for clarifications about your request,
- you can respond to them here.
+ <p>Use this if the public body has asked for clarification of
+ your request.
<% form_for(:outgoing_message, @outgoing_message) do |o| %>
<p>
diff --git a/app/views/request/_request_listing.rhtml b/app/views/request/_request_listing.rhtml
index 7dcc38633..35300929e 100644
--- a/app/views/request/_request_listing.rhtml
+++ b/app/views/request/_request_listing.rhtml
@@ -1,14 +1,36 @@
<% for info_request in info_requests %>
+ <% status = info_request.calculate_status %>
<p class="request_listing">
<%= request_link(info_request) %>
+
<br>
<%=h excerpt(info_request.initial_request_text, "", 300) %>
<br>
<span class="request_listing_bottomline">
+ <strong>
+ <% if info_request.awaiting_description %>
+ Awaiting classification.
+ <% elsif status == 'waiting_response' %>
+ Awaiting response.
+ <% elsif status == 'waiting_response_overdue' %>
+ Response overdue.
+ <% elsif status == 'partially_successful' %>
+ Partially successful.
+ <% elsif status == 'rejected' %>
+ Rejected.
+ <% elsif status == 'successful' %>
+ Successful.
+ <% elsif status == 'waiting_clarification' %>
+ Waiting clarification.
+ <% else %>
+ <% raise "unknown status " + status %>
+ <% end %>
+ </strong>
+
Requested from <%= public_body_link(info_request.public_body) %>
by <%= user_link(info_request.user) %>
- on <%= simple_date(info_request.created_at) %>
+ on <%= simple_date(info_request.created_at) %>.
</span>
</p>
<% end %>
diff --git a/app/views/request/describe_state.rhtml b/app/views/request/describe_state.rhtml
new file mode 100644
index 000000000..4c3e9d006
--- /dev/null
+++ b/app/views/request/describe_state.rhtml
@@ -0,0 +1,23 @@
+<% @title = "New responses to '" + h(@info_request.title) + "'" %>
+
+<%= foi_error_messages_for :incoming_message, :outgoing_message %>
+
+<div id="describe_state_form">
+ <%= render :partial => 'describe_state' %>
+</div>
+
+<div id="show_response_view">
+ <h2>New responses to your request '<%= request_link @info_request %>'</h2>
+
+ <% for correspondence in @correspondences %>
+ <%= render :partial => 'correspondence', :locals => { :correspondence => correspondence } %>
+ <% end %>
+
+ <div id="show_response_followup">
+ <%= render :partial => 'followup', :locals => { :correspondence => @incoming_message } %>
+ </div>
+</div>
+
+<div id="describe_state_form">
+ <%= render :partial => 'describe_state' %>
+</div>
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index 6ab31321b..89726054c 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -1,5 +1,11 @@
<% @title = h(@info_request.title) %>
+<% if @info_request.awaiting_description %>
+ <div id="describe_state_form">
+ <%= render :partial => 'describe_state' %>
+ </div>
+<% end %>
+
<div id="request_main">
<h1><%=@title%></h1>
@@ -10,19 +16,28 @@
</p>
<p id="request_status">
- <% if @status == 'awaiting' %>
+ <% if @info_request.awaiting_description %>
+ <% if @is_owning_user %>
+ Please <strong>answer the question above</strong> so we know whether the
+ most recent response you got contained useful information.
+ <% else %>
+ This request is <strong>awaiting description</strong> by <%= user_link(@info_request.user) %>
+ <% end %>
+ <% elsif @status == 'waiting_response' %>
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' %>
+ <% elsif @status == 'waiting_response_overdue' %>
Currently <strong>overdue a response</strong> from <%=
public_body_link(@info_request.public_body) %>. The
<%= link_to "response was due", about_url %></li>
on <strong><%= simple_date(@date_response_required_by) %></strong>.
- <% elsif @status == 'information' %>
- The request was at least partly <strong>successful</strong>.
- <% elsif @status == 'none' %>
- The request is <strong>not (yet) successful</strong>.
- <% elsif @status == 'unknown' %>
+ <% elsif @status == 'rejected' %>
+ The request was <strong>rejected</strong> by <%= public_body_link(@info_request.public_body) %>.
+ <% elsif @status == 'successful' %>
+ The request was <strong>successful</strong>.
+ <% elsif @status == 'partially_successful' %>
+ The request was <strong>partially successful</strong>.
+ <% elsif @status == 'waiting_clarification' %>
<strong><%= MySociety::Format.fancy_pluralize(@info_request.incoming_messages.size, 'Response', 'responses') %>
received</strong>,
but <%= user_link(@info_request.user) %> has not yet reported whether
@@ -30,9 +45,8 @@
contained useful information or not.
If you are <%= user_link(@info_request.user) %>, please classify them below.
- <!-- This will be useful here too: @info_request.unclassified_responses -->
<% else %>
- <% raise "unknown status " + $status %>
+ <% raise "unknown status " + @status %>
<% end %>
</p>
@@ -51,4 +65,10 @@
<p>...-->
</div>
+<% if @info_request.awaiting_description %>
+ <div id="describe_state_form">
+ <%= render :partial => 'describe_state' %>
+ </div>
+<% end %>
+
diff --git a/app/views/request/show_response.rhtml b/app/views/request/show_response.rhtml
index 98760440e..670dfb08f 100644
--- a/app/views/request/show_response.rhtml
+++ b/app/views/request/show_response.rhtml
@@ -1,9 +1,17 @@
-<% @title = "View and classify FOI response" %>
+<% if @incoming_message.recently_arrived %>
+ <% @title = "New response to '" + h(@info_request.title) + "'" %>
+<% else %>
+ <% @title = "Response to '" + h(@info_request.title) + "'" %>
+<% end %>
<%= foi_error_messages_for :incoming_message, :outgoing_message %>
<div id="show_response_view">
- <h2>New response to your request '<%= request_link @info_request %>'</h2>
+ <% if @incoming_message.recently_arrived %>
+ <h2>New response to your request '<%= request_link @info_request %>'</h2>
+ <% else %>
+ <h2>Response to your request '<%= request_link @info_request %>'</h2>
+ <% end %>
<%= render :partial => 'correspondence', :locals => { :correspondence => @incoming_message } %>
@@ -12,9 +20,3 @@
</div>
</div>
-<% if not @incoming_message.user_classified %>
- <div id="show_response_classify_action">
- <%= render :partial => 'classify' %>
- <div>
-<% end %>
-