diff options
author | francis <francis> | 2008-01-29 03:05:46 +0000 |
---|---|---|
committer | francis <francis> | 2008-01-29 03:05:46 +0000 |
commit | 5acedd09b79642d58c6de5db872f82198b2f2c73 (patch) | |
tree | 1717bd038849262e6abbca2c582cd2d09289c640 | |
parent | de7f36c6e3c5f1739a60839fe6bf3e7d510e1225 (diff) |
Redirect to appropriate messages for most of the classification options.
-rw-r--r-- | app/controllers/application.rb | 3 | ||||
-rw-r--r-- | app/controllers/request_controller.rb | 36 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 8 | ||||
-rw-r--r-- | app/helpers/link_to_helper.rb | 19 | ||||
-rw-r--r-- | app/models/info_request.rb | 13 | ||||
-rw-r--r-- | app/views/help/about.rhtml | 2 | ||||
-rw-r--r-- | app/views/help/unhappy.rhtml | 54 | ||||
-rw-r--r-- | app/views/layouts/default.rhtml | 14 | ||||
-rw-r--r-- | app/views/request/_describe_state.rhtml | 8 | ||||
-rw-r--r-- | app/views/request/describe_state.rhtml | 8 | ||||
-rw-r--r-- | app/views/request/show.rhtml | 16 | ||||
-rw-r--r-- | config/routes.rb | 4 | ||||
-rw-r--r-- | todo.txt | 77 |
13 files changed, 153 insertions, 109 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 23b6e376b..83c606ad2 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application.rb,v 1.27 2008-01-22 17:59:50 francis Exp $ +# $Id: application.rb,v 1.28 2008-01-29 03:05:46 francis Exp $ class ApplicationController < ActionController::Base @@ -112,7 +112,6 @@ class ApplicationController < ActionController::Base # URL generating functions are needed by all controllers (for redirects) # and views (for links), so include them into all of both. include LinkToHelper - end diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 945db8931..9e06a027b 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.41 2008-01-29 01:26:21 francis Exp $ +# $Id: request_controller.rb,v 1.42 2008-01-29 03:05:46 francis Exp $ class RequestController < ApplicationController @@ -16,6 +16,7 @@ class RequestController < ApplicationController @date_response_required_by = @info_request.date_response_required_by @collapse_quotes = params[:unfold] ? false : true @is_owning_user = !authenticated_user.nil? && authenticated_user.id == @info_request.user_id + @needing_description = @info_request.incoming_messages_needing_description end def list @@ -78,12 +79,7 @@ class RequestController < ApplicationController # Page describing state of message posts to def describe_state @info_request = InfoRequest.find(params[:id]) - if @info_request.described_last_incoming_message_id.nil? - @correspondences = @info_request.incoming_messages.find(:all) - else - @correspondences = @info_request.incoming_messages.find(:all, :conditions => "id > " + @info_request.described_last_incoming_message_id.to_s) - end - @correspondences.sort! { |a,b| a.sent_at <=> b.sent_at } + @needing_description = @info_request.incoming_messages_needing_description @is_owning_user = !authenticated_user.nil? && authenticated_user.id == @info_request.user_id if not @info_request.awaiting_description @@ -111,12 +107,30 @@ class RequestController < ApplicationController end @info_request.awaiting_description = false - @info_request.described_last_incoming_message_id = @correspondences[-1].id # XXX lock this with InfoRequest.receive + @info_request.described_last_incoming_message_id = @needing_description[-1].id # XXX lock this with InfoRequest.receive @info_request.described_state = params[:incoming_message][:described_state] @info_request.save! - flash[:notice] = "Thank you for answering!" - # XXX need to prompt for followups here - redirect_to show_request_url(:id => @info_request) + if @info_request.described_state == 'waiting_response' + flash[:notice] = "<p>Thank you! Hopefully your wait isn't too long.</p> <p>By law, you should get a response before the end of <strong>" + simple_date(@info_request.date_response_required_by) + "</strong>.</p>" + redirect_to show_request_url(:id => @info_request) + elsif @info_request.described_state == 'rejected' + # XXX explain how to complain + flash[:notice] = "Oh no! Sorry to hear that your request was rejected. Here is what to do now." + redirect_to unhappy_url + elsif @info_request.described_state == 'successful' + flash[:notice] = "We're glad you got all the information that you wanted. Thank you for using GovernmentSpy." + # XXX quiz them here for a comment + redirect_to show_request_url(:id => @info_request) + elsif @info_request.described_state == 'partially_successful' + flash[:notice] = "We're glad you got some of the information that you wanted." + # XXX explain how to complain / quiz them for a comment + redirect_to show_request_url(:id => @info_request) + elsif @info_request.described_state == 'waiting_clarification' + flash[:notice] = "Please write your follow up message containing the necessary clarifications below." + redirect_to show_response_url(:id => @info_request.id, :incoming_message_id => @needing_description[-1].id) + else + raise "unknown described_state " + @info_request.described_state + end return end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ce78011a0..e40313d1f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,7 +5,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application_helper.rb,v 1.15 2008-01-21 19:12:46 francis Exp $ +# $Id: application_helper.rb,v 1.16 2008-01-29 03:05:47 francis Exp $ module ApplicationHelper # URL generating functions are needed by all controllers (for redirects) @@ -41,11 +41,5 @@ module ApplicationHelper '' end end - - # Basic date format - def simple_date(date) - return date.strftime("%e %B %Y") - end - end diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb index cfa61ec4d..79bdcd904 100644 --- a/app/helpers/link_to_helper.rb +++ b/app/helpers/link_to_helper.rb @@ -5,7 +5,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: link_to_helper.rb,v 1.11 2008-01-22 18:51:21 francis Exp $ +# $Id: link_to_helper.rb,v 1.12 2008-01-29 03:05:47 francis Exp $ module LinkToHelper @@ -52,11 +52,11 @@ module LinkToHelper end - def info_request_link(info_request) link_to h(info_request.title), show_request_url(:id => info_request) end + # Simplified links to our objects # XXX See controllers/user_controller.rb controllers/body_controller.rb for inverse # XXX consolidate somehow with stuff in helpers/application_helper.rb @@ -72,6 +72,15 @@ module LinkToHelper return admin_url_prefix + relative_path end + # About page URLs + def about_url + return help_general_url :action => 'about' + end + def unhappy_url + return help_general_url :action => 'unhappy' + end + + # Where stylesheets used by admin page sit under def admin_public_url(relative_path) admin_url_prefix = MySociety::Config.get("ADMIN_PUBLIC_URL", "/") @@ -82,6 +91,12 @@ module LinkToHelper url_prefix = "http://" + MySociety::Config.get("DOMAIN", '127.0.0.1:3000') return url_prefix + relative_path end + + # Basic date format + def simple_date(date) + return date.strftime("%e %B %Y") + end + end diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 0207bca94..a417ecc3c 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -20,7 +20,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.30 2008-01-29 01:26:21 francis Exp $ +# $Id: info_request.rb,v 1.31 2008-01-29 03:05:47 francis Exp $ require 'digest/sha1' @@ -216,6 +216,17 @@ public return excerpt end + # Returns all the messages which the user hasn't described yet + def incoming_messages_needing_description + if self.described_last_incoming_message_id.nil? + correspondences = self.incoming_messages.find(:all) + else + correspondences = self.incoming_messages.find(:all, :conditions => "id > " + self.described_last_incoming_message_id.to_s) + end + correspondences.sort! { |a,b| a.sent_at <=> b.sent_at } + return correspondences + end + protected # Called by incoming_email and envelope_email diff --git a/app/views/help/about.rhtml b/app/views/help/about.rhtml index ac92602bf..f0524ea28 100644 --- a/app/views/help/about.rhtml +++ b/app/views/help/about.rhtml @@ -1,3 +1,5 @@ +<% @title = "About" %> + <dt>Is this site still in development?</dt> <dd>Yes, that's right. The site is currently being tested with a handful of diff --git a/app/views/help/unhappy.rhtml b/app/views/help/unhappy.rhtml new file mode 100644 index 000000000..a76b2c93c --- /dev/null +++ b/app/views/help/unhappy.rhtml @@ -0,0 +1,54 @@ +<% @title = "Unhappy about a Freedom of Information request?" %> + +<h1>Unhappy about the response you got?</h1> + +<p>If ...</p> + +<ul> +<li>You didn't get a reply within 20 working days</li> +<li>You did not get all of the information that you requested <strong>or</strong></li> +<li>Your request was rejected, but without a reason valid under the law</li> +</ul> + +<p>... you can</p> + +<ol> +<li>Ask for an Internal Review at the public body.</li> +<li>If that doesn't help, complain to the Information Commisioner.</li> +</ol> + +<h1>1. Asking for an Internal Review</h1> + +<p>Contact the Freedom of Information officer at the public body and request an +internal review. +</p> + +<p>You should be able to find the email address for this +by searching the website of the public body. If you filed your request using +GovernmentSpy, you can include a link to the page about your request, so the +internal review has easy access to all the relevant correspondence. +</p> + +<p>The Internal Review should take 2-3 weeks for simple cases, and up to 6 +weeks even for complex reviews. You will then either get the information that +you originally requested, or you will be told that the review upholds the +original decision. +</p> + +<!-- XXX need decent link to more detailed instructions --> + +<h1>2. Complaining to the Information Commissioner</h1> + +<!-- XXX should include brief instructions inline, and link to more detail --> + +<p>If you are still unhappy after the public body had had an internal review, +then you can complain to the Information Commisioner. To do this read +<a href="http://www.ico.gov.uk/complaints/freedom_of_information.aspx">Complaints about Freedom of Information</a> +on the Information Commisioner's website. + +<p>Again, you can include a link to your request on GovernmentSpy, or print +out the whole page of your request, to make it easy to send the relevant information +to the Information Commissioner. + + + diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml index d9b62cdaa..02398dc01 100644 --- a/app/views/layouts/default.rhtml +++ b/app/views/layouts/default.rhtml @@ -41,15 +41,15 @@ </div> <% end %> - <% if flash[:notice] %> - <div id="notice"><%= flash[:notice] %></div> - <% end %> - <% if flash[:error] %> - <div id="error"><%= flash[:error] %></div> - <% end %> - <div id="wrapper"> <div id="content"> + <% if flash[:notice] %> + <div id="notice"><%= flash[:notice] %></div> + <% end %> + <% if flash[:error] %> + <div id="error"><%= flash[:error] %></div> + <% end %> + <div id="<%= controller.controller_name + "_" + controller.action_name %>"> <%= yield :layout %> </div> diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml index 22336972f..068a9fdd5 100644 --- a/app/views/request/_describe_state.rhtml +++ b/app/views/request/_describe_state.rhtml @@ -1,8 +1,6 @@ <% 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> + <h2>What is the status of this request now?</h2> <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> @@ -14,11 +12,13 @@ <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> + <label for="incoming_message_described_state_successful">I've received <strong>all the information</strong> (or equivalents) 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> + <p>Filling this in each time you get a new response helps us track the progress of your request. + </p> <%= hidden_field_tag 'submitted_describe_state', 1 %> <%= submit_tag "Next >>" %> diff --git a/app/views/request/describe_state.rhtml b/app/views/request/describe_state.rhtml index 4c3e9d006..a73bd1611 100644 --- a/app/views/request/describe_state.rhtml +++ b/app/views/request/describe_state.rhtml @@ -1,4 +1,5 @@ -<% @title = "New responses to '" + h(@info_request.title) + "'" %> +<% @title = MySociety::Format.fancy_pluralize(@needing_description.size, 'New response', 'new responses') + + " to '" + h(@info_request.title) + "'" %> <%= foi_error_messages_for :incoming_message, :outgoing_message %> @@ -7,9 +8,10 @@ </div> <div id="show_response_view"> - <h2>New responses to your request '<%= request_link @info_request %>'</h2> + <h2><%=MySociety::Format.fancy_pluralize(@needing_description.size, 'New response', 'new responses') %> + to your request '<%= request_link @info_request %>'</h2> - <% for correspondence in @correspondences %> + <% for correspondence in @needing_description %> <%= render :partial => 'correspondence', :locals => { :correspondence => correspondence } %> <% end %> diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml index 89726054c..dc47de333 100644 --- a/app/views/request/show.rhtml +++ b/app/views/request/show.rhtml @@ -19,9 +19,12 @@ <% 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. + <%= MySociety::Format.fancy_pluralize(@needing_description.size, 'recent response contains', 'recent responses contain') %> useful information. <% else %> - This request is <strong>awaiting description</strong> by <%= user_link(@info_request.user) %> + This request has an <strong>unknown status</strong>. We're waiting for + <%= user_link(@info_request.user) %> to read + <%= MySociety::Format.fancy_pluralize(@needing_description.size, 'a recent response', 'recent responses') %> + and update the status. <% end %> <% elsif @status == 'waiting_response' %> Currently <strong>waiting for a response</strong> from <%= public_body_link(@info_request.public_body) %>, @@ -38,13 +41,8 @@ <% 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 - <%= @info_request.incoming_messages.size == 1 ? 'it' : 'they' %> - contained useful information or not. - - If you are <%= user_link(@info_request.user) %>, please classify them below. + The request is <strong>waiting clarification</strong> + by <%= user_link(@info_request.user) %>. <% else %> <% raise "unknown status " + @status %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index 45401afd0..ec65a667c 100644 --- a/config/routes.rb +++ b/config/routes.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: routes.rb,v 1.31 2008-01-29 01:26:22 francis Exp $ +# $Id: routes.rb,v 1.32 2008-01-29 03:05:48 francis Exp $ ActionController::Routing::Routes.draw do |map| # The priority is based upon order of creation: first created -> highest priority. @@ -32,7 +32,7 @@ ActionController::Routing::Routes.draw do |map| end map.with_options :controller => 'help' do |help| - help.about '/about', :action => 'about' + help.help_general '/help/:action', :action => :action end map.show_public_body "/body/:simple_short_name", :controller => 'body', :action => 'show' @@ -1,7 +1,4 @@ - -search for 'classify' and tidy text -hack storing better info so know when state changed for stats purpose -go through each one and add on the extra stuff +hack storing better info so know when state changed for stats purpose, and for RSS ordering FOI requests to use to test it ============================== @@ -21,67 +18,18 @@ BAILII - relationship with law courts, robots.txt ? "Fundamental Savings Review" - Tom's friend -States -====== - -What I *really* care about is the state of the request for use in the -user interface, e.g. search results, RSS feeds. - -- Awaiting response -- Response overdue -- Awaiting follow up information / clarification from requester -- Responses contain no useful information XXX exact wording matters -- Responses contain some useful information (XXX RSS needs to know when more) -- Response contains all information requested -Flag: awaiting categorisation from requester? - -State to ask about individual messages - -Are you now: - * Awaiting a response - * About to clarify your request - * Looking at a rejection - * Happy with your response - * Partially happy with your response - -Please choose what this response is. - a) an acknowledgement of message received / forwarded on - b) asking for clarification about your request - c) a response containing information - e) a rejection notice - -Brainstorm of things to say if c): - - How satisfied are you that your original request has been answered? - a) Quite satisfied, they've sent most of the information, or equivalent information. - b) Neutral, they sent some useful information, but not all. - c) Dissatisfied, they didn't send the relevant information. - - How much of the information you originally requested have you recieved? - a) All of it. - b) Some of it. - c) None of it. - - Have you now got all the info you originally requested - a) Yes, pretty well. - b) No - - Are you yet satisfied that your original request has been answered? - a) Yes, I now have (most) of the information I wanted from my original request. - b) I received some of the information, or some related useful information. - c) I have received - d) My request was explicitly rejected - Status of messages stuff ======================== -Followups: - - link to the follow up form, or embed in bottom of main request page - - don't show classify link on /response/ page - Use sent again date when there has been resent?, e.g. for http://foi.mysociety.org/request/16 +Make date estimate use follow up time etc. + +Status inputting: + cope with "other" case when something is both (e.g. received some AND clarify) + search for 'classify' and tidy text + Show due date on, e.g. http://foi.mysociety.org/request/4 @@ -129,7 +77,8 @@ Make it so if the pipe fails, exim tries again rather than sending an error to t Or so errors go to an admin somehow, at the very least. Synthesise these tips into our handful of snappy snappy bullet points -http://community.foe.co.uk/tools/right_to_know/tips.html + http://community.foe.co.uk/tools/right_to_know/tips.html + http://www.justice.gov.uk/requestinginformation.htm See if occasional fastcgi errors go away now with Rails 2 [Mon Jan 21 10:38:45 2008] [error] [client 81.107.40.81] FastCGI: incomplete headers (0 bytes) rec @@ -142,7 +91,8 @@ Requests with related content Blog posts / Wikipedia articles about this request Contact page -Finish about page +Finish about page. Use these: + http://www.ico.gov.uk/for_the_public/access_to_official_information.aspx Remember me box This can't possible be the best way, it is too depressing: @@ -225,6 +175,11 @@ Check log rotation is working well Ask what they learnt from request, and other things? and reward by putting their request on front page +Link to: + Disclosure logs + Publication schemes (http://www.ico.gov.uk/what_we_cover/freedom_of_information/publication_schemes.aspx) + + Sources of public bodies ======================== |