aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/help_controller.rb14
-rw-r--r--app/controllers/request_controller.rb3
-rw-r--r--app/models/info_request.rb70
-rw-r--r--app/views/help/about.rhtml40
-rw-r--r--app/views/layouts/default.rhtml1
-rw-r--r--app/views/request/show.rhtml8
-rw-r--r--config/routes.rb8
-rw-r--r--public/stylesheets/main.css7
-rw-r--r--todo.txt12
9 files changed, 142 insertions, 21 deletions
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
new file mode 100644
index 000000000..8a58c1ade
--- /dev/null
+++ b/app/controllers/help_controller.rb
@@ -0,0 +1,14 @@
+# app/controllers/help_controller.rb:
+# Show information about one particular request.
+#
+# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
+# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
+#
+# $Id: help_controller.rb,v 1.1 2008-01-09 15:35:40 francis Exp $
+
+class HelpController < ApplicationController
+
+ def about
+ end
+
+end
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index e665f690a..843446032 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.30 2008-01-04 16:15:40 francis Exp $
+# $Id: request_controller.rb,v 1.31 2008-01-09 15:35:40 francis Exp $
class RequestController < ApplicationController
@@ -13,6 +13,7 @@ class RequestController < ApplicationController
@correspondences = @info_request.incoming_messages + @info_request.info_request_events
@correspondences.sort! { |a,b| a.sent_at <=> b.sent_at }
@status = @info_request.calculate_status
+ @date_response_required_by = @info_request.date_response_required_by
@collapse_quotes = params[:unfold] ? false : true
end
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index e7f9831d6..d86614f1d 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -17,7 +17,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.24 2008-01-04 11:19:18 francis Exp $
+# $Id: info_request.rb,v 1.25 2008-01-09 15:35:40 francis Exp $
require 'digest/sha1'
@@ -94,16 +94,12 @@ public
end
# See if response would be overdue
- overdue = false
- # XXX if a second outgoing message is really a new request, then this
- # is no good
- # We use the last_sent_at date for each outgoing message, as fair
- # enough if the first email bounced or something and it got recent.
- earliest_sent = self.outgoing_messages.map { |om| om.last_sent_at }.min
- time_left = Time.now - earliest_sent
- # XXX use working days
- if time_left > 20.days
+ date_today = Time.now.strftime("%Y-%m-%d")
+ date_response = date_response_required_by.strftime("%Y-%m-%d")
+ if date_today > date_response
overdue = true
+ else
+ overdue = false
end
# Return appropriate status string
@@ -124,6 +120,60 @@ public
end
end
+ # Calculate date by which response is required by law.
+ #
+ # ... "working day” means any day other than a Saturday, a Sunday, Christmas
+ # Day, Good Friday or a day which is a bank holiday under the [1971 c. 80.]
+ # Banking and Financial Dealings Act 1971 in any part of the United Kingdom.
+ #
+ # Freedom of Information Act 2000 section 10
+ #
+ # XXX how do we cope with case where extra info was required from the requester
+ # by the public body in order to fulfill the request, as per sections 1(3) and 10(6b) ?
+ def date_response_required_by
+ # We use the last_sent_at date for each outgoing message, as fair
+ # enough if the first email bounced or something and it got recent.
+ # XXX if a second outgoing message is really a new request, then this
+ # is no good. Likewise, a second outgoing message may contain
+ # clarifications asked for by the public body, and so reset things.
+ # Possibly just show 20 working days since the *last* message? Hmmm.
+ earliest_sent = self.outgoing_messages.map { |om| om.last_sent_at }.min
+
+ days_passed = 0
+ response_required_by = earliest_sent
+ while days_passed < 20
+ response_required_by = response_required_by + 1.day
+ if response_required_by.wday == 0 || response_required_by.wday == 6
+ # not working day, as weekend
+ elsif [
+ # Union of holidays from these places:
+ # http://www.dti.gov.uk/employment/bank-public-holidays/
+ # http://www.scotland.gov.uk/Publications/2005/01/bankholidays
+
+ '2007-11-30', '2007-12-25', '2007-12-26',
+
+ '2008-01-01', '2008-01-02', '2008-03-17', '2008-03-21', '2008-03-24', '2008-05-05',
+ '2008-05-26', '2008-07-14', '2008-08-04', '2008-08-25', '2008-12-01', '2008-12-25', '2008-12-26',
+
+ '2009-01-01', '2009-01-02', '2009-03-17', '2009-04-10', '2009-04-13', '2009-05-04',
+ '2009-05-25', '2009-07-13', '2009-08-03', '2009-08-31', '2009-11-30', '2009-12-25', '2009-12-28',
+
+ '2010-01-01', '2010-01-04', '2010-03-17', '2010-04-02', '2010-04-05', '2010-05-03',
+ '2010-05-31', '2010-07-12', '2010-08-02', '2010-08-30', '2010-11-30', '2010-12-27', '2010-12-28'
+
+
+ ].include?(response_required_by.strftime('%Y-%m-%d'))
+ # bank holiday
+ else
+ days_passed = days_passed + 1
+ end
+ end
+
+ # XXX and give until the end of that 20th working day
+
+ return response_required_by
+ end
+
# Return array of unclassified responses
def unclassified_responses
return self.incoming_messages.select do |msg|
diff --git a/app/views/help/about.rhtml b/app/views/help/about.rhtml
new file mode 100644
index 000000000..371c4bc87
--- /dev/null
+++ b/app/views/help/about.rhtml
@@ -0,0 +1,40 @@
+<dl>
+
+<dt>What is GovernmentSpy for?</dt>
+
+<dd>To help you find out inside information about what the UK government
+is doing.</dd>
+
+<dt>How does the site work?</dt>
+
+<dd>You choose the public body that you would like information from, then
+write a brief note describing what you want to know. We then send your request
+to the public body. Any response they make is automatically published on the
+website for you and anyone else to find and read.
+</dd>
+
+<dt>Why would I bother to do this?</dt>
+
+<dd>You pay taxes, and then Government does things with the money. Some it does
+badly, some it does well. The more we find out about how Government works, the
+better able we are to make suggestions to improve the things that are done badly,
+and to celebrate the things which are done well. This affects a whole range
+of issues important to your life, from healthcare through to national defense.
+</dd>
+
+</dl>
+
+<h1>Making requests</h1>
+<dl>
+
+<dt id="quickly_response">How quickly will I get a response?</dt>
+
+<dd>By law public bodies must respond within 20 days, excluding weekends and
+any UK bank holidays. The date that the response is due by is shown on the
+page for your request. If you have agreed to pay a fee, or if you had to give
+follow up information to clarify your request, the legal date will be slightl
+data.
+</dd>
+
+</dl>
+
diff --git a/app/views/layouts/default.rhtml b/app/views/layouts/default.rhtml
index ef468c522..bf7431e5e 100644
--- a/app/views/layouts/default.rhtml
+++ b/app/views/layouts/default.rhtml
@@ -20,6 +20,7 @@
<li><%=link_to "My Requests", user_url(@user) %></li>
<% else %>
<% end %>
+ <li><%= link_to "About", about_url %></li>
<!-- <li><a href="/about">About</a></li> -->
</ul>
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index 99ba55d11..dd0dbd63b 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -11,11 +11,13 @@
<p id="request_status">
<% if @status == 'awaiting' %>
- Currently <strong>waiting for a response</strong> from <%= public_body_link(@info_request.public_body) %>
+ 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>.
<% elsif @status == 'overdue' %>
Currently <strong>overdue a response</strong> from <%=
- public_body_link(@info_request.public_body) %>. Under section blah of the
- Freedom of Information Act 2000 responses must be made within 20 working days.
+ 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' %>
diff --git a/config/routes.rb b/config/routes.rb
index 020e452a2..0dd6976e6 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.26 2008-01-04 15:12:33 francis Exp $
+# $Id: routes.rb,v 1.27 2008-01-09 15:35:41 francis Exp $
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
@@ -26,7 +26,11 @@ ActionController::Routing::Routes.draw do |map|
user.signup '/signup', :action => 'signup'
user.signout '/signout', :action => 'signout'
user.confirm '/c/:email_token', :action => 'confirm'
- user.show_user "/user/:simple_name", :action => 'show'
+ user.show_user '/user/:simple_name', :action => 'show'
+ end
+
+ map.with_options :controller => 'help' do |help|
+ help.about '/about', :action => 'about'
end
map.show_public_body "/body/:simple_short_name", :controller => 'body', :action => 'show'
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index 44f842881..6dc6a9f96 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -211,7 +211,6 @@ div.fieldWithErrors { display:inline; }
float: right;
}
-
/* /new - submitting requests */
#writeForm {
@@ -288,6 +287,12 @@ table#list_requests .odd {
width: 60%;
}
+/* / - about page */
+
+dt {
+ font-weight: bold;
+ margin-top: 0.5em;
+}
/* User accounts */
diff --git a/todo.txt b/todo.txt
index 1ef0275ba..4b6000675 100644
--- a/todo.txt
+++ b/todo.txt
@@ -19,6 +19,13 @@ BAILII - relationship with law courts, robots.txt ?
Next
====
+Do something about /classify links - so if you send them to another user can still view
+ e.g. http://foi.mysociety.org/classify/12?post_redirect=1
+ Consider renaming them
+
+Let requester send follow-ups - but to which email address???!! aargh
+Alert somewhere if working days table not up to date
+
Test it works if exim is down - e.g. not accepting connections
Remove security warning from admin pages
@@ -27,10 +34,6 @@ Make response messages go to a mailbox as backup
Make it so if the pipe fails, exim tries again rather than sending an error to the public body.
Or so errors go to an admin somehow, at the very least.
-Let requester send follow-ups - but to which email address???!! aargh
-Do something after 20 working days if you get no response
- display the working days correctly
-
Work out how to get it to tell you code coverage of .rhtml files
Make it validate the HTML
maybe with http://www.anodyne.ca/wp-content/uploads/2007/09/be_valid_xhtml.rb
@@ -85,6 +88,7 @@ Synthesise these tips into 4 snappy bullet points
http://community.foe.co.uk/tools/right_to_know/tips.html
Change to Rails 2, may as well do it now rather than later.
+http://www.slashdotdash.net/articles/2007/12/03/rails-2-upgrade-notes
Show public body email address on their public page, with a link to say "this isn't right!"