From dd22ce360817ec14892a1d70e0fa4eb7b3b78804 Mon Sep 17 00:00:00 2001 From: Chrisbr Date: Mon, 2 Jun 2014 14:57:53 +0200 Subject: [PATCH] Implements active user and submissions for global dashboard --- app/assets/stylesheets/osem.css | 6 ++--- .../admin/conference_controller.rb | 2 ++ app/views/admin/conference/index.html.haml | 24 +++++++++++++++---- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/osem.css b/app/assets/stylesheets/osem.css index c065333e..de966a75 100644 --- a/app/assets/stylesheets/osem.css +++ b/app/assets/stylesheets/osem.css @@ -62,8 +62,9 @@ body > #messages { } .dashbox .icon { + padding-left: 8px; display: block; - font-size: 3.5em; + font-size: 2.3em; } .dashbox var { @@ -72,6 +73,3 @@ body > #messages { font-style: normal; } -.dashbox label { - font-size: 1.2em; -} diff --git a/app/controllers/admin/conference_controller.rb b/app/controllers/admin/conference_controller.rb index 047cedfa..ac175e14 100644 --- a/app/controllers/admin/conference_controller.rb +++ b/app/controllers/admin/conference_controller.rb @@ -6,6 +6,8 @@ class Admin::ConferenceController < ApplicationController @new_user = User.where('created_at > ?', current_user.last_sign_in_at).count @new_reg = Registration.where('created_at > ?', current_user.last_sign_in_at).count @total_reg = Registration.count + @active_user = User.where('last_sign_in_at > ?', Date.today - 3.months).count + @submissions_count = Event.count @conferences = Conference.select('id, short_title, color, start_date, registration_end_date, registration_start_date') diff --git a/app/views/admin/conference/index.html.haml b/app/views/admin/conference/index.html.haml index 83d64ea0..136ceecb 100644 --- a/app/views/admin/conference/index.html.haml +++ b/app/views/admin/conference/index.html.haml @@ -1,5 +1,5 @@ .row - .col-sm-3 + .col-sm-2 .dashbox.well.well-sm.text-center .icon %i.glyphicon.glyphicon-user @@ -7,7 +7,7 @@ %var = @total_user %label.text-muted total user - .col-sm-3 + .col-sm-2 .dashbox.well.well-sm.text-center .icon %i.glyphicon.glyphicon-thumbs-up @@ -15,7 +15,15 @@ %var = @new_user %label.text-muted new user - .col-sm-3 + .col-sm-2 + .dashbox.well.well-sm.text-center + .icon + %i.glyphicon.glyphicon-heart-empty + .text + %var + = @active_user + %label.text-muted active user + .col-sm-2 .dashbox.well.well-sm.text-center .icon %i.glyphicon.glyphicon-star @@ -23,7 +31,7 @@ %var = @total_reg %label.text-muted total registrations - .col-sm-3 + .col-sm-2 .dashbox.well.well-sm.text-center .icon %i.glyphicon.glyphicon-usd @@ -31,6 +39,14 @@ %var = @new_reg %label.text-muted new registrations + .col-sm-2 + .dashbox.well.well-sm.text-center + .icon + %i.glyphicon.glyphicon-comment + .text + %var + = @submissions_count + %label.text-muted submissions .row .col-md-12 .well#submissions