diff options
author | francis <francis> | 2008-04-11 15:53:57 +0000 |
---|---|---|
committer | francis <francis> | 2008-04-11 15:53:57 +0000 |
commit | 3770a50e7291be2c9c155d0eee2c58ce2249c3c8 (patch) | |
tree | 791441423091390d98490fbaa8b30daad491757e | |
parent | ebcabc09fd26d0378bd83abb214f53d71c285ac6 (diff) |
Show which user you are in the admin interface
-rw-r--r-- | app/controllers/admin_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/admin_public_body_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/admin_request_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/admin_user_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/application.rb | 5 | ||||
-rw-r--r-- | app/models/public_body.rb | 4 | ||||
-rw-r--r-- | app/views/layouts/admin.rhtml | 3 | ||||
-rw-r--r-- | todo.txt | 11 |
8 files changed, 19 insertions, 16 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 3718b0bd2..33cc9b26c 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -4,10 +4,11 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: admin_controller.rb,v 1.9 2008-04-09 02:51:46 francis Exp $ +# $Id: admin_controller.rb,v 1.10 2008-04-11 15:53:57 francis Exp $ class AdminController < ApplicationController layout "admin" + before_filter :assign_http_auth_user def index # Overview counts of things diff --git a/app/controllers/admin_public_body_controller.rb b/app/controllers/admin_public_body_controller.rb index 22c3208cd..dbaba324a 100644 --- a/app/controllers/admin_public_body_controller.rb +++ b/app/controllers/admin_public_body_controller.rb @@ -4,10 +4,11 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: admin_public_body_controller.rb,v 1.10 2008-03-31 13:26:09 francis Exp $ +# $Id: admin_public_body_controller.rb,v 1.11 2008-04-11 15:53:57 francis Exp $ class AdminPublicBodyController < ApplicationController layout "admin" + before_filter :assign_http_auth_user def index list diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 0dcf9a52c..6e7ebd1b8 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -4,10 +4,11 @@ # 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.8 2008-03-14 10:13:00 francis Exp $ +# $Id: admin_request_controller.rb,v 1.9 2008-04-11 15:53:57 francis Exp $ class AdminRequestController < ApplicationController layout "admin" + before_filter :assign_http_auth_user def index list diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb index e66839bc2..ddbc781f2 100644 --- a/app/controllers/admin_user_controller.rb +++ b/app/controllers/admin_user_controller.rb @@ -4,10 +4,11 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: admin_user_controller.rb,v 1.2 2008-03-14 10:15:43 francis Exp $ +# $Id: admin_user_controller.rb,v 1.3 2008-04-11 15:53:57 francis Exp $ class AdminUserController < ApplicationController layout "admin" + before_filter :assign_http_auth_user def index list diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 39a676669..e8c8ec199 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.36 2008-04-09 01:32:52 francis Exp $ +# $Id: application.rb,v 1.37 2008-04-11 15:53:57 francis Exp $ class ApplicationController < ActionController::Base @@ -123,6 +123,9 @@ class ApplicationController < ActionController::Base return request.env["REMOTE_USER"] end end + def assign_http_auth_user + @http_auth_user = admin_http_auth_user + end # Convert URL name for sort by order, to Lucene query def order_to_sort_by(sortby) diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 689d7dc8d..54f27caed 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: public_body.rb,v 1.55 2008-04-11 12:16:48 francis Exp $ +# $Id: public_body.rb,v 1.56 2008-04-11 15:53:57 francis Exp $ require 'csv' require 'set' @@ -210,7 +210,7 @@ class PublicBody < ActiveRecord::Base # Give an error listing ones that are to be deleted deleted_ones = set_of_existing - set_of_importing if deleted_ones.size > 0 - errors.push "error: Some " + tag + " bodies are in database, but not in CSV file: " + Array(deleted_ones).join(", ") + errors.push "error: Some " + tag + " bodies are in database, but not in CSV file: " + Array(deleted_ones).join(", ") + "\n" end # Rollback if a dry run, or we had errors diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml index a5e71efbc..d4f22f412 100644 --- a/app/views/layouts/admin.rhtml +++ b/app/views/layouts/admin.rhtml @@ -10,12 +10,13 @@ </head> <body> - <p><b><%= link_to 'WhatDoTheyKnow', main_url('/') %> admin interface:</b> + <p><strong><%= link_to 'WhatDoTheyKnow', main_url('/') %> admin interface</strong> <%= link_to 'Overview', admin_url('') %> | <%= link_to 'Timeline', admin_url('timeline') %> | <%= link_to 'Public authorities', admin_url('body/list') %> | <%= link_to 'Requests', admin_url('request/list') %> | <%= link_to 'Users', admin_url('user/list') %> + - you are <%= h @http_auth_user %> </p> <p style="color: green"><%= flash[:notice] %></p> @@ -1,10 +1,3 @@ -CVS commits: - -Fix duplicate by by (see http://www.whatdotheyknow.com/track/feed/5) -Added more privacy warnings to preview -Fix escaping of HTML in titles in RSS -Improved CSV import function a bit - FOI requests to use to test it ============================== @@ -57,6 +50,8 @@ Things to track: - new requests with keyword - successful responses +Interface for DPA hiding + Later ===== @@ -102,7 +97,7 @@ when sending "my response is late" Holding pen with comments - new requests don't get sent straight away, but are delayed while people help improve them. -Change email address - easier to do now with post_redirect.circumstance? +Change email address interface - easier to do now with post_redirect.circumstance? Consider showing Subject: of email somewhere e.g. for http://www.whatdotheyknow.com/request/172/response/234 |