Commit aa831b34 authored by Tiago Botelho's avatar Tiago Botelho Committed by André Luís

Moves application helper logic for system header and footer to its EE counterpart

parent b505557d
...@@ -283,23 +283,10 @@ module ApplicationHelper ...@@ -283,23 +283,10 @@ module ApplicationHelper
end end
end end
def appearance
@appearance ||= Appearance.current
end
def page_class def page_class
class_names = [] class_names = []
class_names << 'issue-boards-page' if current_controller?(:boards) class_names << 'issue-boards-page' if current_controller?(:boards)
class_names << 'with-performance-bar' if performance_bar_enabled? class_names << 'with-performance-bar' if performance_bar_enabled?
class_names += system_message_class
class_names
end
def system_message_class
class_names = []
class_names << 'with-system-header' if appearance.show_header?
class_names << 'with-system-footer' if appearance.show_footer?
class_names class_names
end end
......
...@@ -9,5 +9,29 @@ module EE ...@@ -9,5 +9,29 @@ module EE
(_('You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the %{primary_node}.') % (_('You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the %{primary_node}.') %
{ primary_node: link_to('primary node', ::Gitlab::Geo.primary_node.url) }).html_safe { primary_node: link_to('primary node', ::Gitlab::Geo.primary_node.url) }).html_safe
end end
def page_class
class_names = super
class_names += system_message_class
class_names
end
def system_message_class
class_names = []
return class_names unless appearance
class_names << 'with-system-header' if appearance.show_header?
class_names << 'with-system-footer' if appearance.show_footer?
class_names
end
private
def appearance
::Appearance.current
end
end end
end end
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