diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-02-19 13:02:48 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-02-25 16:26:52 +1100 |
commit | e31d002858e9dd6b790285ce21f35ca1ae8fa72c (patch) | |
tree | 7fa6ea917c7e4c1c24e1c9488d954f9b7d4a461d /app/controllers | |
parent | 2a193d3bc74b812bd9ddee9d7520ca1e98007511 (diff) |
Merge in adminbootstraptheme 323d704ab4f1ffe31f20fcabeaf030c462dfbadf into main project
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin_general_controller.rb | 11 | ||||
-rw-r--r-- | app/controllers/admin_track_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/general_controller.rb | 6 |
3 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb index 9f4c398c1..81c34a3b3 100644 --- a/app/controllers/admin_general_controller.rb +++ b/app/controllers/admin_general_controller.rb @@ -115,6 +115,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 diff --git a/app/controllers/admin_track_controller.rb b/app/controllers/admin_track_controller.rb index 03217da45..525c96782 100644 --- a/app/controllers/admin_track_controller.rb +++ b/app/controllers/admin_track_controller.rb @@ -9,6 +9,7 @@ class AdminTrackController < AdminController @query = params[:query] @admin_tracks = TrackThing.paginate :order => "created_at desc", :page => params[:page], :per_page => 100, :conditions => @query.nil? ? nil : ["lower(track_query) like lower('%'||?||'%')", @query ] + @popular = ActiveRecord::Base.connection.select_all("select count(*) as count, title, info_request_id from track_things join info_requests on info_request_id = info_requests.id where info_request_id is not null group by info_request_id, title order by count desc limit 10;") end private diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index a8bbc22ff..d34f75a72 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -230,6 +230,10 @@ class GeneralController < ApplicationController render(:layout => false, :content_type => 'text/css') end - + # For merged adminbootstraptheme + # TODO: Remove this ugly hack + def admin_js + render :layout => false, :content_type => "application/javascript" + end end |