summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/helpers/application_helper.rb10
-rw-r--r--app/views/admin/application_settings/geo.html.haml6
-rw-r--r--app/views/admin/application_settings/templates.html.haml8
-rw-r--r--app/views/layouts/nav/sidebar/_admin.html.haml22
4 files changed, 21 insertions, 25 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index bb7ae03313c..7846de9f481 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -6,7 +6,15 @@ 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)
+ render(partial, locals) if partial_exists?(partial)
+ end
+
+ def partial_exists?(partial)
+ lookup_context.exists?(partial, [], true)
+ end
+
+ def view_exists?(partial)
+ lookup_context.exists?(partial, [], false)
end
# Check if a particular controller is the current one
diff --git a/app/views/admin/application_settings/geo.html.haml b/app/views/admin/application_settings/geo.html.haml
deleted file mode 100644
index b1741d9eef3..00000000000
--- a/app/views/admin/application_settings/geo.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-- breadcrumb_title "Geo"
-- page_title "Geo"
-- @content_class = "limit-container-width" unless fluid_layout
-- expanded = Rails.env.test?
-
-= render_if_exists 'admin/application_settings/geo', expanded: expanded
diff --git a/app/views/admin/application_settings/templates.html.haml b/app/views/admin/application_settings/templates.html.haml
deleted file mode 100644
index dd814e59960..00000000000
--- a/app/views/admin/application_settings/templates.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-- breadcrumb_title "Templates"
-- page_title "Templates"
-- @content_class = "limit-container-width" unless fluid_layout
-- expanded = Rails.env.test?
-
-= render_if_exists 'admin/application_settings/templates', expanded: expanded
-
-= render_if_exists 'admin/application_settings/custom_templates_form', expanded: expanded
diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml
index cceea58b98e..f1aad481820 100644
--- a/app/views/layouts/nav/sidebar/_admin.html.haml
+++ b/app/views/layouts/nav/sidebar/_admin.html.haml
@@ -219,11 +219,12 @@
= link_to repository_admin_application_settings_path, title: _('Repository') do
%span
= _('Repository')
- %li.divider.fly-out-top-item
- = nav_link(path: 'application_settings#templates') do
- = link_to templates_admin_application_settings_path, title: _('Templates') do
- %span
- = _('Templates')
+ - if view_exists?('admin/application_settings/templates')
+ %li.divider.fly-out-top-item
+ = nav_link(path: 'application_settings#templates') do
+ = link_to templates_admin_application_settings_path, title: _('Templates') do
+ %span
+ = _('Templates')
%li.divider.fly-out-top-item
= nav_link(path: 'application_settings#ci_cd') do
= link_to ci_cd_admin_application_settings_path, title: _('CI/CD') do
@@ -244,11 +245,12 @@
= link_to network_admin_application_settings_path, title: _('Network') do
%span
= _('Network')
- %li.divider.fly-out-top-item
- = nav_link(path: 'application_settings#geo') do
- = link_to geo_admin_application_settings_path, title: _('Geo') do
- %span
- = _('Geo')
+ - if view_exists?('admin/application_settings/geo')
+ %li.divider.fly-out-top-item
+ = nav_link(path: 'application_settings#geo') do
+ = link_to geo_admin_application_settings_path, title: _('Geo') do
+ %span
+ = _('Geo')
%li.divider.fly-out-top-item
= nav_link(path: 'application_settings#preferences') do
= link_to preferences_admin_application_settings_path, title: _('Preferences') do