diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-09-20 13:24:20 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-09-20 13:24:20 +0000 |
commit | 00057a75f4f7433d8594ec7adb480ab39a7cb008 (patch) | |
tree | 2630af73ad1c3a8510152cf0e7cb3e9103c6d942 /app/helpers | |
parent | ac3157a0d5c3cd32ebc68c0f29e48d7a9c64edc5 (diff) | |
parent | 26225e778d7e5beb9861756890bf2fddb19af77b (diff) | |
download | gitlab-ce-00057a75f4f7433d8594ec7adb480ab39a7cb008.tar.gz |
Merge branch '44998-split-admin-settings-into-multiple-sub-pages' into 'master'
Resolve "Split admin settings into multiple sub pages"
Closes #44998
See merge request gitlab-org/gitlab-ce!21467
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 10 | ||||
-rw-r--r-- | app/helpers/application_settings_helper.rb | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index ef4560023af..32fc8e5e9ce 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,7 +7,15 @@ module ApplicationHelper # See https://docs.gitlab.com/ee/development/ee_features.html#code-in-app-views # rubocop: disable CodeReuse/ActiveRecord 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 template_exists?(template) + lookup_context.exists?(template, [], false) end # rubocop: enable CodeReuse/ActiveRecord diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 3ebf0162cb6..dc393968786 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -264,4 +264,8 @@ module ApplicationSettingsHelper :web_ide_clientside_preview_enabled ] end + + def expanded_by_default? + Rails.env.test? + end end |