diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/request_controller.rb | 16 | ||||
-rw-r--r-- | app/views/request/_describe_state.rhtml | 19 | ||||
-rw-r--r-- | app/views/request/_other_describe_state.rhtml | 72 |
3 files changed, 95 insertions, 12 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index ae4f3a229..0c3ee596f 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: request_controller.rb,v 1.155 2009-04-07 10:32:54 louise Exp $ +# $Id: request_controller.rb,v 1.156 2009-04-14 13:36:32 louise Exp $ class RequestController < ApplicationController @@ -26,6 +26,7 @@ class RequestController < ApplicationController @collapse_quotes = params[:unfold] ? false : true @update_status = params[:update_status] ? true : false @is_owning_user = @info_request.is_owning_user?(authenticated_user) + @old_unclassified = @info_request.is_old_unclassified? && !authenticated_user.nil? if @update_status return if !@is_owning_user && !authenticated_as_user?(@info_request.user, @@ -248,11 +249,11 @@ class RequestController < ApplicationController @is_owning_user = @info_request.is_owning_user?(authenticated_user) @events_needing_description = @info_request.events_needing_description @last_info_request_event_id = @info_request.last_event_id_needing_description - @new_responses_count = @events_needing_description.select {|i| i.event_type == 'response'}.size - + @old_unclassified = @info_request.is_old_unclassified? && !authenticated_user.nil? + # Check authenticated, and parameters set. We check is_owning_user # to get admin overrides (see owns_every_request? above) - if !@is_owning_user && !authenticated_as_user?(@info_request.user, + if !@old_unclassified && !@is_owning_user && !authenticated_as_user?(@info_request.user, :web => "To classify the response to this FOI request", :email => "Then you can classify the FOI response you have got from " + @info_request.public_body.name + ".", :email_subject => "Classify an FOI response from " + @info_request.public_body.name @@ -281,6 +282,13 @@ class RequestController < ApplicationController redirect_to request_url(@info_request) return end + + if @old_unclassified && !@is_owning_user + flash[:notice] = '<p>Thank you for updating this request!</p>' + RequestMailer.deliver_old_unclassified_updated(@info_request) + redirect_to request_url(@info_request) + return + end # Display appropriate next page (e.g. help for complaint etc.) if @info_request.calculate_status == 'waiting_response' diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml index 8b3ac2cf3..f75a76c4d 100644 --- a/app/views/request/_describe_state.rhtml +++ b/app/views/request/_describe_state.rhtml @@ -93,14 +93,17 @@ <%= submit_tag "Submit status" %> (and we'll suggest <strong>what to do next</strong>) </p> <% end %> +<% elsif @old_unclassified %> + <%= render :partial => 'other_describe_state', :locals => {:id_suffix => id_suffix } %> <% else %> - We don't know whether the most recent response to this request contains - information or not - – - if you are - <%= user_link(@info_request.user) %>, - please - <%= link_to "sign in", signin_url(:r => request.request_uri) %> - and let everyone know. + We don't know whether the most recent response to this request contains + information or not + – + 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/_other_describe_state.rhtml b/app/views/request/_other_describe_state.rhtml new file mode 100644 index 000000000..6bfff9b2a --- /dev/null +++ b/app/views/request/_other_describe_state.rhtml @@ -0,0 +1,72 @@ + + +<% form_for(:incoming_message, @info_request, :url => describe_state_url(:id => @info_request.id)) do |f| %> + <h2>Can you help us by describing the status of this request now?</h2> + + <hr> <!------------------------------------------------> + + <% if @info_request.described_state != 'internal_review' %> + <div> + <%= radio_button "incoming_message", "described_state", "waiting_response", :id => 'waiting_response' + id_suffix %> + <label for="waiting_response<%=id_suffix%>"> <strong>No response</strong> has been received</label> + </div> + <% end %> + <% if @info_request.described_state == 'internal_review' %> + <div> + <%= radio_button "incoming_message", "described_state", "internal_review", :id => 'internal_review' + id_suffix %> + <label for="internal_review<%=id_suffix%>">Still awaiting an <strong>internal review</strong></label> + </div> + <% end %> + + <% if @info_request.described_state != 'internal_review' %> + <div> + <%= radio_button "incoming_message", "described_state", "waiting_clarification", :id => 'waiting_clarification' + id_suffix %> + <label for="waiting_clarification<%=id_suffix%>"><strong>Clarification</strong> has been requested</label> + </div> + <% end %> + + <div> + <%= radio_button "incoming_message", "described_state", "gone_postal", :id => 'gone_postal' + id_suffix %> + <label for="gone_postal<%=id_suffix%>">A response will be sent <strong>by post</strong></label> + </div> + + <hr> <!------------------------------------------------> + + <% if @info_request.described_state == 'internal_review' %> + <p>The <strong>review has finished</strong> and overall:</p> + <% end %> + + <div> + <%= radio_button "incoming_message", "described_state", "not_held", :id => 'not_held' + id_suffix %> + <label for="not_held<%=id_suffix%>">The authority do <strong>not have</strong> the information <small>(maybe they say who does)</small></label> + </div> + <div> + <%= radio_button "incoming_message", "described_state", "partially_successful", :id => 'partially_successful' + id_suffix %> + <label for="partially_successful<%=id_suffix%>"><strong>Some of the information</strong> has been sent </label> + </div> + <div> + <%= radio_button "incoming_message", "described_state", "successful", :id => 'successful' + id_suffix %> + <label for="successful<%=id_suffix%>"><strong>All the information</strong> has been sent</label> + </div> + <div> + <%= radio_button "incoming_message", "described_state", "rejected", :id => 'rejected' + id_suffix %> + <label for="rejected<%=id_suffix%>">The request has been <strong>rejected</strong></label> + </div> + + <hr> <!------------------------------------------------> + + <div> + <%= radio_button "incoming_message", "described_state", "error_message", :id => 'error_message' + id_suffix %> + <label for="error_message<%=id_suffix%>"> + An <strong>error message</strong> has been received + </label> + </div> + + <hr> + + <p> + <%= hidden_field_tag 'last_info_request_event_id', @last_info_request_event_id, :id => 'last_info_request_event_id' + id_suffix %> + <%= hidden_field_tag 'submitted_describe_state', 1, :id => 'submitted_describe_state' + id_suffix %> + <%= submit_tag "Submit status" %> + </p> +<% end %> |