diff options
author | francis <francis> | 2008-04-03 15:42:57 +0000 |
---|---|---|
committer | francis <francis> | 2008-04-03 15:42:57 +0000 |
commit | 30681a75ad0cd31ea1e832f673bf08344ad6338b (patch) | |
tree | 61c13f4ff1d6c2707fa1cc10c811b875efa5732d | |
parent | 600c09a5e0f96e3b22527ce9ec69c164277483d8 (diff) |
Show track things on admin pages.
-rw-r--r-- | app/views/admin_user/show.rhtml | 22 | ||||
-rw-r--r-- | config/routes.rb | 5 |
2 files changed, 25 insertions, 2 deletions
diff --git a/app/views/admin_user/show.rhtml b/app/views/admin_user/show.rhtml index 8ffcbd129..390b345e3 100644 --- a/app/views/admin_user/show.rhtml +++ b/app/views/admin_user/show.rhtml @@ -17,6 +17,28 @@ <p><%= link_to 'Public page', main_url(user_url(@admin_user)) %></p> +<h2>Track things</h2> + +<table> + <tr> + <th>Id</th> + <% for column in TrackThing.content_columns %> + <th><%= column.human_name %></th> + <% end %> + <th>Items sent by email</th> + </tr> + +<% for track_thing in @admin_user.track_things.find(:all, :order => 'created_at desc') %> + <tr class="<%= cycle('odd', 'even') %>"> + <td><%=h track_thing.id %></td> + <% for column in TrackThing.content_columns.map { |c| c.name } %> + <td><%=h track_thing.send(column) %></td> + <% end %> + <td><%= track_thing.track_things_sent_emails.size %></td> + </tr> +<% end %> +</table> + <h2>Post redirects</h2> diff --git a/config/routes.rb b/config/routes.rb index 5b7d224ea..8b9288ea3 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.49 2008-04-01 16:40:38 francis Exp $ +# $Id: routes.rb,v 1.50 2008-04-03 15:42:57 francis Exp $ ActionController::Routing::Routes.draw do |map| @@ -63,7 +63,8 @@ ActionController::Routing::Routes.draw do |map| # NB: We don't use routes to *construct* admin URLs, as they need to be relative # paths to work on the live site proxied over HTTPS to secure.mysociety.org - map.connect '/admin/:action', :controller => 'admin', :action => 'index' + map.connect '/admin/', :controller => 'admin', :action => 'index' + map.connect '/admin/timeline', :controller => 'admin', :action => 'timeline' 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' |