From 48ee697bf2fa4536be6dbee9cb579fde625d50b4 Mon Sep 17 00:00:00 2001 From: Martin Wortschack Date: Tue, 11 Sep 2018 17:24:34 +0200 Subject: remove 'Geo' and 'Templates' template from CE and display menu items for EE only --- app/helpers/application_helper.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'app/helpers/application_helper.rb') 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 -- cgit v1.2.1