Commit 48ee697b authored by Martin Wortschack's avatar Martin Wortschack 🐻

remove 'Geo' and 'Templates' template from CE and display menu items for EE only

parent b4c7e722
Pipeline #29927631 failed with stages
in 53 minutes and 8 seconds
......@@ -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
......
- 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
- 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
......@@ -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
......
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