aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/admin_general_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-03-19 14:02:25 -0700
committerLouise Crow <louise.crow@gmail.com>2013-03-19 14:02:25 -0700
commitb394b67663916c865452cc784d8642f72a305be5 (patch)
tree63c92172fe7813e6354da0ead628ed2192ef0ee2 /app/controllers/admin_general_controller.rb
parent8d21293461ce4b564261686ab8d6460f5fe51259 (diff)
parentf83b917ec2c59da0ce7c27da19b740366da58419 (diff)
Merge branch 'release/0.8' into wdtk
Conflicts: app/controllers/admin_request_controller.rb app/views/contact_mailer/from_admin_message.rhtml
Diffstat (limited to 'app/controllers/admin_general_controller.rb')
-rw-r--r--app/controllers/admin_general_controller.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb
index 9f4c398c1..800678787 100644
--- a/app/controllers/admin_general_controller.rb
+++ b/app/controllers/admin_general_controller.rb
@@ -5,6 +5,8 @@
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
class AdminGeneralController < AdminController
+ skip_before_filter :authenticate, :only => :admin_js
+
def index
# ensure we have a trailing slash
current_uri = request.env['REQUEST_URI']
@@ -115,6 +117,17 @@ class AdminGeneralController < AdminController
end
def stats
+ # Overview counts of things
+ @public_body_count = PublicBody.count
+
+ @info_request_count = InfoRequest.count
+ @outgoing_message_count = OutgoingMessage.count
+ @incoming_message_count = IncomingMessage.count
+
+ @user_count = User.count
+ @track_thing_count = TrackThing.count
+
+ @comment_count = Comment.count
@request_by_state = InfoRequest.count(:group => 'described_state')
@tracks_by_type = TrackThing.count(:group => 'track_type')
end
@@ -128,5 +141,10 @@ class AdminGeneralController < AdminController
@github_origin = "https://github.com/#{repo}/tree/"
@request_env = request.env
end
+
+ # TODO: Remove this when support for proxy admin interface is removed
+ def admin_js
+ render :layout => false, :content_type => "application/javascript"
+ end
end