diff options
-rw-r--r-- | app/controllers/admin_controller.rb | 8 | ||||
-rw-r--r-- | app/views/admin/index.rhtml | 10 | ||||
-rw-r--r-- | todo.txt | 2 |
3 files changed, 16 insertions, 4 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 4713af8a9..9562e6945 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -4,16 +4,21 @@ # 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.3 2008-03-14 11:08:41 francis Exp $ +# $Id: admin_controller.rb,v 1.4 2008-03-17 10:54:42 francis Exp $ class AdminController < ApplicationController layout "admin" def index + # Overview counts of things @user_count = User.count @public_body_count = PublicBody.count @info_request_count = InfoRequest.count + # Tasks to do + @requires_admin_requests = InfoRequest.find(:all, :conditions => ["described_state = 'requires_admin'"]) + + # Recent events @events_title = "Events in last week" date_back_to = Time.now - 1.week if params[:month] @@ -24,7 +29,6 @@ class AdminController < ApplicationController @events_title = "Events, all time" date_back_to = Time.now - 1000.years end - @events = InfoRequestEvent.find(:all, :order => "created_at desc, id desc", :conditions => ["created_at > ? ", date_back_to]) end diff --git a/app/views/admin/index.rhtml b/app/views/admin/index.rhtml index f5308b35a..270dc1130 100644 --- a/app/views/admin/index.rhtml +++ b/app/views/admin/index.rhtml @@ -8,6 +8,16 @@ <li><%=@user_count%> users</li> </ul> +<% if @requires_admin_requests.size > 0 %> + <h2>Requests requiring admin attention</h2> + + <ul> + <% for @requires_admin_request in @requires_admin_requests %> + <li><%= link_to h(@requires_admin_request.title), main_url(request_url(@requires_admin_request)) %></li> + <% end %> + </ul> +<% end %> + <h2><%=h @events_title%></h2> <p><a href="?">Week</a> @@ -1,5 +1,3 @@ - -Remove complaint_email Add list of things to do |