diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-20 13:41:41 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-20 13:41:41 +0200 |
commit | b07c02eb13fca5f991575bb0955373d54f1a2d9d (patch) | |
tree | b2a7dd1dbd74d857710991f6a613932e6f53dcf1 | |
parent | e3a718574c1c862a1b806b8bb04fa1f4b10a2d37 (diff) | |
download | gitlab-ce-b07c02eb13fca5f991575bb0955373d54f1a2d9d.tar.gz |
Add more info to admin dashboard
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/controllers/admin/dashboard_controller.rb | 1 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 8 | ||||
-rw-r--r-- | app/helpers/icons_helper.rb | 17 | ||||
-rw-r--r-- | app/views/admin/dashboard/index.html.haml | 44 | ||||
-rw-r--r-- | lib/gitlab/backend/shell.rb | 9 | ||||
-rw-r--r-- | lib/tasks/gitlab/check.rake | 5 |
6 files changed, 72 insertions, 12 deletions
diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index 3c80b6503fa..be19139c9b1 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -2,5 +2,6 @@ class Admin::DashboardController < Admin::ApplicationController def index @projects = Project.order("created_at DESC").limit(10) @users = User.order("created_at DESC").limit(10) + @groups = Group.order("created_at DESC").limit(10) end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d8cbd8f0286..04fda026bf3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -187,14 +187,6 @@ module ApplicationHelper Gitlab.config.extra end - def public_icon - content_tag :i, nil, class: 'icon-globe cblue' - end - - def private_icon - content_tag :i, nil, class: 'icon-lock cgreen' - end - def search_placeholder if @project && @project.persisted? "Search in this project" diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb new file mode 100644 index 00000000000..41249a56acb --- /dev/null +++ b/app/helpers/icons_helper.rb @@ -0,0 +1,17 @@ +module IconsHelper + def boolean_to_icon(value) + if value.to_s == "true" + content_tag :i, nil, class: 'icon-circle cgreen' + else + content_tag :i, nil, class: 'icon-circle cgray' + end + end + + def public_icon + content_tag :i, nil, class: 'icon-globe cblue' + end + + def private_icon + content_tag :i, nil, class: 'icon-lock cgreen' + end +end diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 3064763b993..9cd909611bc 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -52,6 +52,19 @@ ago .span4 + %h4 Latest groups + %hr + - @groups.each do |group| + %p + = link_to [:admin, group] do + = group.name + %span.light.pull-right + = time_ago_in_words group.created_at + ago + +%br +.row + .span4 %h4 Stats %hr %p @@ -82,3 +95,34 @@ Milestones %span.light.pull-right = Milestone.count + .span4 + %h4 + Features + %hr + %p + Sign up + %span.light.pull-right + = boolean_to_icon gitlab_config.signup_enabled + %p + LDAP + %span.light.pull-right + = boolean_to_icon Gitlab.config.ldap.enabled + %p + Gravatar + %span.light.pull-right + = boolean_to_icon Gitlab.config.gravatar.enabled + %p + OmniAuth + %span.light.pull-right + = boolean_to_icon Gitlab.config.omniauth.enabled + .span4 + %h4 Components + %hr + %p + GitLab + %span.pull-right + = Gitlab::VERSION + %p + GitLab Shell + %span.pull-right + = Gitlab::Shell.new.version diff --git a/lib/gitlab/backend/shell.rb b/lib/gitlab/backend/shell.rb index c819ce56ac9..5020fa1f991 100644 --- a/lib/gitlab/backend/shell.rb +++ b/lib/gitlab/backend/shell.rb @@ -196,6 +196,15 @@ module Gitlab Gitlab.config.gitlab_shell.ssh_path_prefix + "#{path}.git" end + # Return GitLab shell version + def version + gitlab_shell_version_file = "#{gitlab_shell_user_home}/gitlab-shell/VERSION" + + if File.readable?(gitlab_shell_version_file) + File.read(gitlab_shell_version_file) + end + end + protected def gitlab_shell_user_home diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake index 4ee24d1cc2b..f2349ca8c13 100644 --- a/lib/tasks/gitlab/check.rake +++ b/lib/tasks/gitlab/check.rake @@ -611,10 +611,7 @@ namespace :gitlab do end def gitlab_shell_version - gitlab_shell_version_file = "#{gitlab_shell_user_home}/gitlab-shell/VERSION" - if File.readable?(gitlab_shell_version_file) - File.read(gitlab_shell_version_file) - end + Gitlab::Shell.new.version end def has_gitlab_shell3? |