Implements global dashboard since last login boxes

This commit is contained in:
Chrisbr 2014-05-31 20:39:29 +02:00
parent 70c7f78024
commit ce6413530c
3 changed files with 61 additions and 0 deletions

View file

@ -55,3 +55,25 @@ body > #messages {
display: inline-block;
padding: 0px 10px 0px 0px;
}
.dashbox {
text-align: center;
padding-top: 20px;
padding-bottom: 20px;
}
.dashbox .icon {
display: block;
font-size: 3.5em;
text-align: center;
}
.dashbox var {
display: block;
font-size: 2em;
font-style: normal;
}
.dashbox label {
font-size: 1.2em;
}

View file

@ -2,6 +2,12 @@ class Admin::ConferenceController < ApplicationController
before_filter :verify_organizer
def index
last_sign_in = current_user.last_sign_in_at
@total_user = User.count
@new_user = User.where('created_at > ?', last_sign_in).count
@new_reg = Registration.where('created_at > ?', last_sign_in).count
@total_reg = Registration.count
@conferences = Conference.select('id, short_title, color, start_date,
registration_end_date, registration_start_date')

View file

@ -1,3 +1,36 @@
.row
.col-sm-3
.dashbox.well.well-sm
.icon
%i.glyphicon.glyphicon-user
.text
%var
= @total_user
%label.text-muted total user
.col-sm-3
.dashbox.well.well-sm
.icon
%i.glyphicon.glyphicon-thumbs-up
.text
%var
= @new_user
%label.text-muted new user
.col-sm-3
.dashbox.well.well-sm
.icon
%i.glyphicon.glyphicon-star
.text
%var
= @total_reg
%label.text-muted total registrations
.col-sm-3
.dashbox.well.well-sm
.icon
%i.glyphicon.glyphicon-usd
.text
%var
= @new_reg
%label.text-muted new registrations
.row
.col-md-12
.well#submissions