diff options
author | francis <francis> | 2008-04-14 10:02:55 +0000 |
---|---|---|
committer | francis <francis> | 2008-04-14 10:02:55 +0000 |
commit | 010dbab855324b6268fb77f1953d9ffe95dc0a44 (patch) | |
tree | f4b03d76b0a7823d2c1278cc42279d2d2f5502fb | |
parent | 93c2bfba3241adb65022ba3b717e4c10b0859703 (diff) |
Interface for destroying requests entirely.
-rw-r--r-- | app/controllers/admin_request_controller.rb | 14 | ||||
-rw-r--r-- | app/views/admin_request/edit.rhtml | 17 | ||||
-rw-r--r-- | app/views/layouts/admin.rhtml | 4 | ||||
-rw-r--r-- | public/stylesheets/admin.css | 6 | ||||
-rw-r--r-- | todo.txt | 3 |
5 files changed, 41 insertions, 3 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 6e7ebd1b8..3620b019c 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_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: admin_request_controller.rb,v 1.9 2008-04-11 15:53:57 francis Exp $ +# $Id: admin_request_controller.rb,v 1.10 2008-04-14 10:02:55 francis Exp $ class AdminRequestController < ApplicationController layout "admin" @@ -67,6 +67,18 @@ class AdminRequestController < ApplicationController end end + def fully_destroy + @info_request = InfoRequest.find(params[:id]) + + user = @info_request.user + url_title = @info_request.url_title + + @info_request.fully_destroy + + flash[:notice] = "Request #{url_title} has been completely destroyed. Email of user who made request: " + user.email + redirect_to admin_url('request/list') + end + def edit_outgoing @outgoing_message = OutgoingMessage.find(params[:id]) end diff --git a/app/views/admin_request/edit.rhtml b/app/views/admin_request/edit.rhtml index c343c2c49..e6d40337c 100644 --- a/app/views/admin_request/edit.rhtml +++ b/app/views/admin_request/edit.rhtml @@ -25,8 +25,10 @@ 'partially_successful', 'requires_admin', ]) %> + </p> - <%= submit_tag 'Save' %> + <p><%= submit_tag 'Save changes' %> + </p> <p><strong>Note:</strong> To edit the actual request body text, click edit next to the specific outgoing message. @@ -34,6 +36,19 @@ <% end %> +<hr> + +<% form_tag '../fully_destroy/' + @info_request.id.to_s do %> + <p> + <strong>This is permanent and irreversible!</strong> <%= submit_tag 'Destory request entirely' %> + <br>Use it mainly if someone posts private information, e.g. made a Data Protection request. It + destroys all responses and tracks as well. + </p> + +<% end %> + +<hr> + <p> <%= link_to 'Show', '../show/' + @info_request.id.to_s %> | <%= link_to 'List all', '../list' %> diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml index 51814b0d1..b9b362332 100644 --- a/app/views/layouts/admin.rhtml +++ b/app/views/layouts/admin.rhtml @@ -20,7 +20,9 @@ - you are <%= h @http_auth_user %> </p> - <p style="color: green"><%= flash[:notice] %></p> + <% if flash[:notice] %> + <p id="notice"><%= flash[:notice] %></p> + <% end %> <%= yield %> diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 2b11ff278..df6b6da6a 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css @@ -27,3 +27,9 @@ form { margin-bottom: 1em; } +#notice { + color: green; + border: solid 1px green; + padding: 1em; +} + @@ -28,6 +28,8 @@ BAILII - relationship with law courts, robots.txt ? Next ==== +Link more clearly to full request and next/previous correspondence (ask Matthew) + Check date order here http://www.whatdotheyknow.com/track/feed/5 @@ -45,6 +47,7 @@ https://secure.mysociety.org/admin/foi/request/show/137 GUI for uploading changed CSV files Interface for deleting requests +Make tag categories better Things to track: - new requests |