Commit 1a64afbc authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Extract ee-only code under /ee dir

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 8ab12abd
class Admin::DashboardController < Admin::ApplicationController class Admin::DashboardController < Admin::ApplicationController
prepend ::EE::Admin::DashboardController
def index def index
@projects = Project.order_id_desc.without_deleted.with_route.limit(10) @projects = Project.order_id_desc.without_deleted.with_route.limit(10)
@users = User.order_id_desc.limit(10) @users = User.order_id_desc.limit(10)
@groups = Group.order_id_desc.with_route.limit(10) @groups = Group.order_id_desc.with_route.limit(10)
@license = License.current @license = License.current
# EE only
@admin_count = User.admins.count
@roles_count = ProjectAuthorization.roles_stats
end end
end end
# rubocop:disable Gitlab/ModuleWithInstanceVariables
module EE
module Admin
module DashboardController
extend ActiveSupport::Concern
prepended do
before_action :set_roles_count, only: [:index]
end
private
def set_roles_count
@admin_count = ::User.admins.count
@roles_count = ::ProjectAuthorization.roles_stats
end
end
end
end
%div - if @admin_count
%p %p
Admin users Admin users
%span.light.pull-right %span.light.pull-right
= @admin_count = @admin_count
- if @roles_count
- @roles_count.reverse_each do |row| - @roles_count.reverse_each do |row|
%p %p
Users with highest role Users with highest role
%strong #{row['kind']} %strong
= row['kind']
%span.light.pull-right %span.light.pull-right
= row['amount'] = row['amount']
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