aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-08-31 23:43:52 +0000
committerfrancis <francis>2008-08-31 23:43:52 +0000
commite5181d8b593b08e7d63b9c1b37bfb6a0fdab0573 (patch)
treee8a02bf0193dfab464b0fa3ea94dbc54a87bda60
parent77529bce892d3fdb991be5bc993f4e2ea6e45143 (diff)
Add details box to the requires admin form.
-rw-r--r--app/controllers/request_controller.rb6
-rw-r--r--app/models/info_request.rb9
-rw-r--r--app/models/request_mailer.rb6
-rw-r--r--app/views/request/_describe_state.rhtml3
-rw-r--r--app/views/request_mailer/requires_admin.rhtml2
-rw-r--r--public/stylesheets/main.css3
-rw-r--r--todo.txt10
7 files changed, 24 insertions, 15 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 217863aa3..19a602571 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.101 2008-08-31 16:02:25 francis Exp $
+# $Id: request_controller.rb,v 1.102 2008-08-31 23:43:52 francis Exp $
class RequestController < ApplicationController
@@ -212,7 +212,7 @@ class RequestController < ApplicationController
end
# Make the state change
- @info_request.set_described_state(params[:incoming_message][:described_state])
+ @info_request.set_described_state(params[:incoming_message][:described_state], params[:incoming_message][:requires_admin_details])
# Display appropriate next page (e.g. help for complaint etc.)
if @info_request.calculate_status == 'waiting_response'
@@ -241,7 +241,7 @@ class RequestController < ApplicationController
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 => @events_needing_description[-1].params[:incoming_message_id])
elsif @info_request.calculate_status == 'requires_admin'
- flash[:notice] = "Thanks! The WhatDoTheyKnow team have been notified."
+ flash[:notice] = "Thanks! The WhatDoTheyKnow team have been notified. <a href=\"/help/contact\">Contact us</a> if you have more to say about how we should handle this."
redirect_to request_url(@info_request)
else
raise "unknown calculate_status " + @info_request.calculate_status
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 07dbbccd5..f32a7b3e7 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -23,7 +23,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.134 2008-08-31 15:46:00 francis Exp $
+# $Id: info_request.rb,v 1.135 2008-08-31 23:43:53 francis Exp $
require 'digest/sha1'
require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian')
@@ -308,7 +308,7 @@ public
end
# change status, including for last event for later historical purposes
- def set_described_state(new_state)
+ def set_described_state(new_state, details = nil)
ActiveRecord::Base.transaction do
self.awaiting_description = false
last_event = self.get_last_event
@@ -321,7 +321,10 @@ public
self.calculate_event_states
if new_state == 'requires_admin'
- RequestMailer.deliver_requires_admin(self)
+ RequestMailer.deliver_requires_admin(self, details)
+ else
+ # XXX this chucks details if we are not moving to requires_admin -
+ # the user is not meant to have entered any.
end
end
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index eb4d83349..a4e92252e 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.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_mailer.rb,v 1.48 2008-08-31 16:02:26 francis Exp $
+# $Id: request_mailer.rb,v 1.49 2008-08-31 23:43:53 francis Exp $
class RequestMailer < ApplicationMailer
@@ -56,13 +56,13 @@ class RequestMailer < ApplicationMailer
end
# An FOI response is outside the scope of the system, and needs admin attention
- def requires_admin(info_request)
+ def requires_admin(info_request, details)
@from = contact_from_name_and_email
@recipients = @from
@subject = "Unusual FOI response - " + info_request.title
url = main_url(request_url(info_request))
admin_url = request_admin_url(info_request)
- @body = {:info_request => info_request, :url => url, :admin_url => admin_url }
+ @body = {:info_request => info_request, :url => url, :admin_url => admin_url, :details => details }
end
# Tell the requester that a new response has arrived
diff --git a/app/views/request/_describe_state.rhtml b/app/views/request/_describe_state.rhtml
index 84c600db4..ece2fa3ee 100644
--- a/app/views/request/_describe_state.rhtml
+++ b/app/views/request/_describe_state.rhtml
@@ -21,7 +21,8 @@
<label for="partially_successful<%=id_suffix%>">I've received <strong>some of the information</strong> that I asked for</label>
<br>
<%= radio_button "incoming_message", "described_state", "requires_admin", :id => 'requires_admin' + id_suffix %>
- <label for="requires_admin<%=id_suffix%>"><strong>None</strong> of the above - e.g. add a new option here</label>
+ <label for="requires_admin<%=id_suffix%>"><strong>None</strong> of the above - enter quick summary here:</label>
+ <%= text_field "incoming_message", 'requires_admin_details', :class => 'requires_admin_details', :size => 60 %></p>
</p>
<p>Filling this in helps everyone track the progress of your request.
</p>
diff --git a/app/views/request_mailer/requires_admin.rhtml b/app/views/request_mailer/requires_admin.rhtml
index 882ef73ce..4b9f0ddfa 100644
--- a/app/views/request_mailer/requires_admin.rhtml
+++ b/app/views/request_mailer/requires_admin.rhtml
@@ -5,5 +5,7 @@ to let them know what you are going to do about it.
Request '<%=@info_request.title%>':
<%= @url %>
+Details: "<%= @details %>"
+
Administration URL:
<%= @admin_url %>
diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css
index 2cf5af126..6181e51cc 100644
--- a/public/stylesheets/main.css
+++ b/public/stylesheets/main.css
@@ -598,6 +598,9 @@ div.pagination { text-align: center; padding-top: 0.3em;}
font-size: 1.0em;
color: #454545;
}
+.requires_admin_details {
+ margin-left: 1.8em;
+}
/*---------------- content : request detail pages */
diff --git a/todo.txt b/todo.txt
index e001c5cc7..dcd0a4edb 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,6 +1,3 @@
-Test with/ without followup message
-Check displays right name
-
Site move:
Install PostgresSQL 8.3
Move database
@@ -27,6 +24,11 @@ Clear out all the need classifying requests
Test data for Tony
+When forcing auth user for followups is a bit confusing/weird, does it really work?
+ Perhaps remove signout dialog and have signin instead?
+ Should we say auth for followups sooner as you have to be certain user?
+Display of login dialog to log in as particular user if you are logged out isn't centred nicely
+
Admin:
Have internal links to different parts of request page
Somehow fold up the enormous pages on many admin pages
@@ -56,8 +58,6 @@ Use spelling correction for public bodies search (in addition to substring?)
Flag bad comments, delete comments from admin interface
-Preview when sending followups - especially people need to see quoting/subject
-Spell checking for followups
Later
=====