aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/request_controller.rb5
-rw-r--r--app/models/rejection_reason.rb40
-rw-r--r--app/views/request/_correspondence.rhtml37
-rw-r--r--app/views/request/classify.rhtml63
-rw-r--r--app/views/request/new.rhtml8
-rw-r--r--app/views/request/show.rhtml37
-rw-r--r--app/views/user/_signin.rhtml4
-rw-r--r--app/views/user/_signup.rhtml8
-rw-r--r--config/routes.rb4
-rw-r--r--public/stylesheets/main.css18
-rw-r--r--todo.txt9
11 files changed, 175 insertions, 58 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 818545c05..6bfee315e 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.17 2007-11-19 12:36:57 francis Exp $
+# $Id: request_controller.rb,v 1.18 2007-11-22 15:22:35 francis Exp $
class RequestController < ApplicationController
@@ -60,7 +60,8 @@ class RequestController < ApplicationController
# Did the incoming message contain info?
def classify
- @info_request = InfoRequest.find(params[:id])
+ @incoming_message = IncomingMessage.find(params[:outgoing_message_id])
+ @info_request = @incoming_message.info_request
if authenticated_as_user?(@info_request.user,
:web => "To view and classify the response to this FOI request",
diff --git a/app/models/rejection_reason.rb b/app/models/rejection_reason.rb
index c3cc55d7d..347aeff1f 100644
--- a/app/models/rejection_reason.rb
+++ b/app/models/rejection_reason.rb
@@ -6,15 +6,45 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: rejection_reason.rb,v 1.1 2007-11-14 01:01:39 francis Exp $
+# $Id: rejection_reason.rb,v 1.2 2007-11-22 15:22:36 francis Exp $
class RejectionReason < ActiveRecord::Base
belongs_to :incoming_message
validates_presence_of :incoming_message_id
- def self.all_reasons
- ['commerciallyconfidential']
- end
+ @@all_reasons = [
+ { "section21" => "Information accessible to applicant by other means" },
+ { "section22" => "Information intended for future publication" },
+ { "section23" => "Information supplied by, or relating to, bodies dealing with security matters" },
+ { "section24" => "National security" },
+ { "section25" => "Certificates under ss. 23 and 24: supplementary provisions" },
+ { "section26" => "Defence" },
+ { "section27" => "International relations" },
+ { "section28" => "Relations within the United Kingdom" },
+ { "section29" => "The economy" },
+ { "section30" => "Investigations and proceedings conducted by public authorities" },
+ { "section31" => "Law enforcement" },
+ { "section32" => "Court records, etc" },
+ { "section33" => "Audit functions" },
+ { "section34" => "Parliamentary privilege" },
+ { "section35" => "Formulation of government policy, etc" },
+ { "section36" => "Prejudice to effective conduct of public affairs" },
+ { "section37" => "Communications with Her Majesty, etc. and honours" },
+ { "section38" => "Health and safety" },
+ { "section39" => "Environmental information" },
+ { "section40" => "Personal information" },
+ { "section41" => "Information provided in confidence" },
+ { "section42" => "Legal professional privilege" },
+ { "section43" => "Commercial interests" },
+ { "section44" => "Prohibitions on disclosure" }
+ ]
+ @@all_reasons_array = @@all_reasons.map{ |h| h.keys }.flatten
+ @@all_reasons_hash = {}
+ @@all_reasons.each { |h| @@all_reasons_hash.merge!(h) }
- validates_inclusion_of :reason, :in => RejectionReason.all_reasons
+ cattr_accessor :all_reasons_array
+ cattr_accessor :all_reasons_hash
+
+# validates_inclusion_of :reason, :in => RejectionReason.all_reasons_array
end
+
diff --git a/app/views/request/_correspondence.rhtml b/app/views/request/_correspondence.rhtml
new file mode 100644
index 000000000..5695c87ff
--- /dev/null
+++ b/app/views/request/_correspondence.rhtml
@@ -0,0 +1,37 @@
+<div id="correspondence">
+
+<% if (correspondence.class.to_s == 'OutgoingMessage')
+ outgoing_message = correspondence %>
+ <%= render :partial => 'bubble', :locals => { :body => outgoing_message.body } %>
+
+ <p class="xspeaker">
+ <%= user_link(@info_request.user) %>
+
+ <% if outgoing_message.message_type == 'initial_request' %>
+ sent the initial request
+ <% if outgoing_message.status == 'sent' %>
+ to <%= public_body_link(@info_request.public_body) %>
+ on <strong><%= simple_date(outgoing_message.sent_at) %></strong>
+ <% elsif outgoing_message.status == 'ready' %>
+ it has <strong>not yet been sent</strong>
+ <% else raise "unknown outgoing_message.status" %>
+ <% end %>
+ <% else raise "unknown outgoing_message.message_type" %>
+ <% end %>
+ </p>
+<% elsif (correspondence.class.to_s == 'IncomingMessage')
+ incoming_message = correspondence%>
+ <%= render :partial => 'bubble', :locals => { :body => incoming_message.mail.body } %>
+
+ <p class="xspeaker">
+ <%= incoming_message.mail.friendly_from %>
+ of <%= public_body_link(@info_request.public_body) %>
+ wrote a reply on <strong><%= simple_date(incoming_message.sent_at)
+ %></strong>
+ </p>
+<% else %>
+ <% raise "Unknown correspondence type" + correspondence.class.to_s %>
+<% end %>
+
+</div>
+
diff --git a/app/views/request/classify.rhtml b/app/views/request/classify.rhtml
new file mode 100644
index 000000000..07d68b703
--- /dev/null
+++ b/app/views/request/classify.rhtml
@@ -0,0 +1,63 @@
+<% @title = "Classify FOI response" %>
+
+<%= foi_error_messages_for :rejection_reason %>
+
+<div id="classify_view">
+<h2>New response to your request '<%= request_link @info_request %>'</h2>
+
+<%= render :partial => 'correspondence', :locals => { :correspondence => @incoming_message } %>
+</div>
+
+<div id="classify_action">
+<% form_for(:rejection_reason, @info_request ) do |f| %>
+ <h2>Classify the response</h2>
+ <p>Does this response contain any of the information that you requested?</p>
+ <% fields_for :incoming_message do |o| %>
+ <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 anything useful</label>
+ </p>
+ <% end %>
+
+
+ <h2>Rejection reasons</h2>
+
+ <p>Does this response give any
+ <a href="http://www.opsi.gov.uk/Acts/acts2000/plain/ukpga_20000036_en#pt2">reasons under the FOI Act 2000</a>
+ for rejecting your request, or part of your request?</p>
+
+ <p>
+ <%= radio_button "dummy", "reasons_given", "false" %>
+ <label for="dummy_reasons_given_false">No reasons for rejection under sections of an Act are given</label>
+ <br>
+ <%= radio_button "dummy", "reasons_given", "true" %>
+ <label for="dummy_reasons_given_true">Yes, they have given reasons for rejection</label>
+ </p>
+
+ <p>If yes, choose all the reasons given for rejection.</p>
+
+ <p>
+ <% for code_name in RejectionReason.all_reasons_array %>
+ <% human_name = RejectionReason.all_reasons_hash[code_name] %>
+ <%= check_box "reason", code_name %>
+ <label for="reason_<%= code_name %>">
+ <%=
+ code_name =~ /section(\d+)/
+ if not $1.nil?
+ "Section " + $1 + "."
+ end
+ %>
+ <%= human_name %>
+ </label>
+ <br>
+ <% end %>
+ </p>
+
+ <%= submit_tag "Update" %>
+
+<% end %>
+<div>
+
diff --git a/app/views/request/new.rhtml b/app/views/request/new.rhtml
index c4d00f00c..61d6cc019 100644
--- a/app/views/request/new.rhtml
+++ b/app/views/request/new.rhtml
@@ -4,11 +4,11 @@
<% form_for(:info_request, @info_request, :url => { :action => :create }, :html => { :id => 'writeForm' } ) do |f| %>
- <label for="heading">&nbsp;</label>
+ <label class="form_label" for="heading">&nbsp;</label>
<h1>New public Freedom of Information request</h1>
<p>
- <label for="public_body_id">Public body:</label>
+ <label class="form_label" for="public_body_id">Public body:</label>
<%=
@public_bodies = PublicBody.find(:all, :order => "name")
f.collection_select(:public_body_id, @public_bodies, :id, :name)
@@ -17,7 +17,7 @@
<p>
- <label for="info_request_title">Summary:</label>
+ <label class="form_label" for="info_request_title">Summary:</label>
<%= f.text_field :title, :size => 50 %>
</p>
<div class="form_item_note">
@@ -27,7 +27,7 @@
<% fields_for :outgoing_message do |o| %>
<p>
- <label for="outgoing_message_body">Your letter:</label>
+ <label class="form_label" for="outgoing_message_body">Your letter:</label>
<%= o.text_area :body, :rows => 20, :cols => 60 %>
</p>
<% end %>
diff --git a/app/views/request/show.rhtml b/app/views/request/show.rhtml
index 8b29c3009..64c9492cd 100644
--- a/app/views/request/show.rhtml
+++ b/app/views/request/show.rhtml
@@ -30,41 +30,6 @@ successful or a rejection.
</p>
<% for correspondence in @correspondences %>
- <div id="correspondence">
-
- <% if (correspondence.class.to_s == 'OutgoingMessage')
- outgoing_message = correspondence %>
- <%= render :partial => 'bubble', :locals => { :body => outgoing_message.body } %>
-
- <p class="xspeaker">
- <%= user_link(@info_request.user) %>
-
- <% if outgoing_message.message_type == 'initial_request' %>
- sent the initial request
- <% if outgoing_message.status == 'sent' %>
- to <%= public_body_link(@info_request.public_body) %>
- on <strong><%= simple_date(outgoing_message.sent_at) %></strong>
- <% elsif outgoing_message.status == 'ready' %>
- it has <strong>not yet been sent</strong>
- <% else raise "unknown outgoing_message.status" %>
- <% end %>
- <% else raise "unknown outgoing_message.message_type" %>
- <% end %>
- </p>
- <% elsif (correspondence.class.to_s == 'IncomingMessage')
- incoming_message = correspondence%>
- <%= render :partial => 'bubble', :locals => { :body => incoming_message.mail.body } %>
-
- <p class="xspeaker">
- <%= incoming_message.mail.friendly_from %>
- of <%= public_body_link(@info_request.public_body) %>
- wrote a reply on <strong><%= simple_date(incoming_message.sent_at)
- %></strong>
- </p>
- <% else %>
- <% raise "Unknown correspondence type" + correspondence.class.to_s %>
- <% end %>
-
- </div>
+ <%= render :partial => 'correspondence', :locals => { :correspondence => correspondence } %>
<% end %>
diff --git a/app/views/user/_signin.rhtml b/app/views/user/_signin.rhtml
index 16d5b2ebd..846fbcd8d 100644
--- a/app/views/user/_signin.rhtml
+++ b/app/views/user/_signin.rhtml
@@ -8,12 +8,12 @@
<% end %>
<p>
- <label for="signin_email"><strong>Your e-mail:</strong></label>
+ <label class="form_label" for="signin_email"><strong>Your e-mail:</strong></label>
<%= text_field 'user', 'email', { :size => 20, :id => 'signin_email' } %>
</p>
<p>
- <label for="signin_password"><strong>Password:</strong></label>
+ <label class="form_label" for="signin_password"><strong>Password:</strong></label>
<%= password_field 'user', 'password', { :size => 15, :id => 'signin_password' } %>
</p>
diff --git a/app/views/user/_signup.rhtml b/app/views/user/_signup.rhtml
index f172f9359..fd2f454f6 100644
--- a/app/views/user/_signup.rhtml
+++ b/app/views/user/_signup.rhtml
@@ -8,7 +8,7 @@
<% end %>
<p>
- <label for="signup_email"><strong>Your e-mail:</strong></label>
+ <label class="form_label" for="signup_email"><strong>Your e-mail:</strong></label>
<%= text_field 'user', 'email', { :size => 20, :id => 'signup_email' } %>
</p>
<div class="form_item_note">
@@ -16,7 +16,7 @@
</div>
<p>
- <label for="signup_name"><strong>Your name:</strong></label>
+ <label class="form_label" for="signup_name"><strong>Your name:</strong></label>
<%= text_field 'user', 'name', { :size => 20, :id => 'signup_name' } %>
</p>
<div class="form_item_note">Your <strong>name will appear
@@ -25,12 +25,12 @@
anonymous.</div>
<p>
- <label for="signup_password"><strong>Password:</strong></label>
+ <label class="form_label" for="signup_password"><strong>Password:</strong></label>
<%= password_field 'user', 'password', { :size => 15, :id => 'signup_password' } %>
</p>
<p>
- <label for="signup_password_confirmation"><strong>Password: (again)</strong></label>
+ <label class="form_label" for="signup_password_confirmation"><strong>Password: (again)</strong></label>
<%= password_field 'user', 'password_confirmation', { :size => 15, :id => 'signup_password_confirmation' } %>
</p>
diff --git a/config/routes.rb b/config/routes.rb
index 1d08007b8..04c56a818 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.21 2007-11-14 01:01:39 francis Exp $
+# $Id: routes.rb,v 1.22 2007-11-22 15:22:36 francis Exp $
ActionController::Routing::Routes.draw do |map|
# The priority is based upon order of creation: first created -> highest priority.
@@ -19,7 +19,7 @@ ActionController::Routing::Routes.draw do |map|
request.new_request '/new', :action => 'new'
request.create_request '/create', :action => 'create'
request.show_request '/request/:id', :action => 'show'
- request.classify_request '/classify/:id', :action => 'classify'
+ request.classify_request '/classify/:outgoing_message_id', :action => 'classify'
end
map.with_options :controller => 'user' do |user|
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index e4728314e..7e8e7a0fa 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -139,14 +139,14 @@ select, input, textarea {
font-size: 99%;
}
-label {
+.form_label {
clear: both;
float: left;
text-align: right;
padding-right: 0.5em;
margin-bottom: 0.5em;
}
-label {
+.form_label {
width: 16em;
}
.form_note {
@@ -244,6 +244,18 @@ table#list_requests .odd {
/* /request - viewing requests */
+/* /classify - classifying requests */
+
+#classify_action {
+ float: right;
+ width: 35%;
+}
+
+#classify_view {
+ float: left;
+ width: 60%;
+}
+
/* User accounts */
@@ -271,7 +283,7 @@ table#list_requests .odd {
margin-right: 15%;
}
-#sign_together label {
+#sign_together .form_label {
width: 8em;
}
#sign_together .form_note {
diff --git a/todo.txt b/todo.txt
index 350b4dec0..b0e125a3d 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,6 +1,12 @@
Form for requestor to choose what happened
+[12:11:25] … To Liverpool City Council:
+
+Please send me a copy of the contract signed with Veolia for refuse and recycling collection.
+
+Check these out for ids
+http://www.ico.gov.uk/Home/tools_and_resources/decision_notices.aspx
Next
====
@@ -93,6 +99,9 @@ http://community.foe.co.uk/tools/right_to_know/request_generator.html
Look at this basic US site
http://www.rcfp.org/foi_letter/generate.php
+This is interesting
+http://www.liverpool.gov.uk/Council_government_and_democracy/About_your_council/Data_protection_and_FOI/FOI/Suppliers_and_Contractors/index.asp
+
Add spelling checker as in WTT
For grey hints in input fields