diff options
author | francis <francis> | 2008-03-14 11:08:41 +0000 |
---|---|---|
committer | francis <francis> | 2008-03-14 11:08:41 +0000 |
commit | 3b846c4414aa0e7bf3638b92fe0c6928a8b4c6f6 (patch) | |
tree | fd68afdcc167cd262a95ca868d1efdc9bbeada83 /app/controllers/admin_controller.rb | |
parent | 29bc26f5feddcd72cddc8d7b2fcb9e4eeba19736 (diff) |
Overview admin page.
Diffstat (limited to 'app/controllers/admin_controller.rb')
-rw-r--r-- | app/controllers/admin_controller.rb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 76fb8de07..4713af8a9 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -4,9 +4,29 @@ # 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.2 2007-10-31 17:25:29 francis Exp $ +# $Id: admin_controller.rb,v 1.3 2008-03-14 11:08:41 francis Exp $ class AdminController < ApplicationController - layout "admin" + layout "admin" + + def index + @user_count = User.count + @public_body_count = PublicBody.count + @info_request_count = InfoRequest.count + + @events_title = "Events in last week" + date_back_to = Time.now - 1.week + if params[:month] + @events_title = "Events in last month" + date_back_to = Time.now - 1.month + end + if params[:all] + @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 end |