diff options
-rw-r--r-- | app/controllers/admin_controller.rb | 6 | ||||
-rw-r--r-- | app/views/admin/debug.rhtml | 18 | ||||
-rw-r--r-- | app/views/layouts/admin.rhtml | 5 | ||||
-rw-r--r-- | config/routes.rb | 3 | ||||
-rwxr-xr-x | script/restart-mongrel | 4 |
5 files changed, 31 insertions, 5 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 33cc9b26c..64f367b92 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_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_controller.rb,v 1.10 2008-04-11 15:53:57 francis Exp $ +# $Id: admin_controller.rb,v 1.11 2008-04-11 16:10:12 francis Exp $ class AdminController < ApplicationController layout "admin" @@ -46,5 +46,9 @@ class AdminController < ApplicationController @events.sort! { |a,b| b.created_at <=> a.created_at } end + + def debug + @request_env = request.env + end end diff --git a/app/views/admin/debug.rhtml b/app/views/admin/debug.rhtml new file mode 100644 index 000000000..8a3fcc895 --- /dev/null +++ b/app/views/admin/debug.rhtml @@ -0,0 +1,18 @@ +<% @title = "Debug" %> + +<h1><%=@title%></h1> + +<h2>Environment variables</h2> +<pre> +<%= @request_env.to_yaml %> +</pre> + +<h2>Parameters</h2> +<pre> +<%= params.to_yaml %> +</pre> + +<h2>Session</h2> +<pre> +<%= session.to_yaml %> +</pre> diff --git a/app/views/layouts/admin.rhtml b/app/views/layouts/admin.rhtml index d4f22f412..51814b0d1 100644 --- a/app/views/layouts/admin.rhtml +++ b/app/views/layouts/admin.rhtml @@ -10,13 +10,14 @@ </head> <body> - <p><strong><%= link_to 'WhatDoTheyKnow', main_url('/') %> admin interface</strong> + <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 %> + | <%= link_to 'Debug', admin_url('debug') %> + - you are <%= h @http_auth_user %> </p> <p style="color: green"><%= flash[:notice] %></p> diff --git a/config/routes.rb b/config/routes.rb index bbe0c6610..313439081 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.52 2008-04-09 01:32:55 francis Exp $ +# $Id: routes.rb,v 1.53 2008-04-11 16:10:12 francis Exp $ ActionController::Routing::Routes.draw do |map| @@ -69,6 +69,7 @@ ActionController::Routing::Routes.draw do |map| # paths to work on the live site proxied over HTTPS to secure.mysociety.org map.connect '/admin/', :controller => 'admin', :action => 'index' map.connect '/admin/timeline', :controller => 'admin', :action => 'timeline' + map.connect '/admin/debug', :controller => 'admin', :action => 'debug' map.connect '/admin/body/:action/:id', :controller => 'admin_public_body' map.connect '/admin/request/:action/:id', :controller => 'admin_request' map.connect '/admin/user/:action/:id', :controller => 'admin_user' diff --git a/script/restart-mongrel b/script/restart-mongrel index 6fd47d32b..691baff9e 100755 --- a/script/restart-mongrel +++ b/script/restart-mongrel @@ -7,7 +7,9 @@ cd .. # XXX Include path for dodgy version of daemonize package if [ -e log/mongrel.pid ] then - ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails restart + ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails stop + sleep 1s + ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails start -d else ruby -I/usr/lib/ruby/ /usr/bin/mongrel_rails start -d fi |