Commit 35e21b34 authored by randx's avatar randx
Browse files

Admin dashboard

parent 08a8b7c02cd4
......@@ -903,3 +903,20 @@ li.note {
.milestone {
@extend .wll;
}
/**
* Admin area
*
*/
.admin_dash {
.data {
a {
h1 {
line-height:48px;
font-size:48px;
padding:20px;
text-align:center;
}
}
}
}
class Admin::DashboardController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :authenticate_admin!
def index
@workers = Resque.workers
@pending_jobs = Resque.size(:post_receive)
@projects = Project.order("created_at DESC").limit(10)
@users = User.order("created_at DESC").limit(10)
end
end
.admin_dash.row
.span4
.ui-box
%h5
Resque Workers
.data.padded
= link_to "/info/resque" do
%h1{:class => @workers.present? ? "cgreen" : "cred"}
= @workers.count
%hr
%p
%strong{:class => @pending_jobs > 0 ? "cred" : "cgreen"}
#{@pending_jobs} post receive jobs waiting
.span4
.ui-box
%h5 Projects
.data.padded
= link_to admin_projects_path do
%h1= Project.count
%hr
= link_to 'New Project', new_admin_project_path, :class => "btn small"
.span4
.ui-box
%h5 Users
.data.padded
= link_to admin_users_path do
%h1= User.count
%hr
= link_to 'New User', new_admin_user_path, :class => "btn small"
.row
.span6
%h3 Latest projects
%hr
- @projects.each do |project|
%h5
= link_to project.name, [:admin, project]
.span6
%h3 Latest users
%hr
- @users.each do |user|
%h5
= link_to user.name, [:admin, user]
......@@ -7,6 +7,7 @@
.container
%nav.main_menu
= render "layouts/const_menu_links"
= link_to "Stats", admin_root_path, :class => controller.controller_name == "dashboard" ? "current" : nil
= link_to "Projects", admin_projects_path, :class => controller.controller_name == "projects" ? "current" : nil
= link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil
= link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil
......
......@@ -29,7 +29,7 @@
get 'mailer/preview_note'
get 'mailer/preview_user_new'
get 'mailer/preview_issue_new'
root :to => "users#index"
root :to => "dashboard#index"
end
get "errors/githost"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment