diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-05-23 15:56:11 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-05-23 15:56:11 +0300 |
commit | 4634e749ee743a8d5123a23d63c18cb0b9350711 (patch) | |
tree | d01f428446e0810f13f899e219211d7b6a00f6bf /app | |
parent | 4a56a6a1b743b4adb5f4de7833efc8caa97a6132 (diff) |
CE: Use render_if_exists to hide EE specific codes
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 5 | ||||
-rw-r--r-- | app/views/admin/dashboard/index.html.haml | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index aa4569500b8..f5d94ad96a1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,6 +2,11 @@ require 'digest/md5' require 'uri' module ApplicationHelper + # See https://docs.gitlab.com/ee/development/ee_features.html#code-in-app-views + def render_if_exists(partial, locals = {}) + render(partial, locals) if lookup_context.exists?(partial, [], true) + end + # Check if a particular controller is the current one # # args - One or more controller names to check diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 41ef646fc0e..cfa1d9d0f0c 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -2,6 +2,8 @@ - breadcrumb_title "Dashboard" %div{ class: container_class } + = render_if_exists "admin/licenses/breakdown", license: @license + .admin-dashboard.prepend-top-default .row .col-sm-4 @@ -20,6 +22,7 @@ %h3.text-center Users: = approximate_count_with_delimiters(User) + = render_if_exists 'users_statistics' %hr = link_to 'New user', new_admin_user_path, class: "btn btn-new" .col-sm-4 @@ -97,6 +100,9 @@ = reply_email %span.light.pull-right = boolean_to_icon Gitlab::IncomingEmail.enabled? + + = render_if_exists 'elastic_and_geo' + - container_reg = "Container Registry" %p{ "aria-label" => "#{container_reg}: status " + (Gitlab.config.registry.enabled ? "on" : "off") } = container_reg @@ -144,6 +150,9 @@ GitLab Pages %span.pull-right = Gitlab::Pages::VERSION + + = render_if_exists 'geo' + %p Ruby %span.pull-right |