2015-04-26 12:48:37 +05:30
|
|
|
module NavHelper
|
2016-04-02 18:10:28 +05:30
|
|
|
def page_gutter_class
|
|
|
|
if current_path?('merge_requests#show') ||
|
2017-08-17 22:00:37 +05:30
|
|
|
current_path?('merge_requests#diffs') ||
|
|
|
|
current_path?('merge_requests#commits') ||
|
|
|
|
current_path?('merge_requests#builds') ||
|
|
|
|
current_path?('merge_requests#conflicts') ||
|
|
|
|
current_path?('merge_requests#pipelines') ||
|
|
|
|
current_path?('issues#show') ||
|
|
|
|
current_path?('milestones#show')
|
2016-04-02 18:10:28 +05:30
|
|
|
if cookies[:collapsed_gutter] == 'true'
|
|
|
|
"page-gutter right-sidebar-collapsed"
|
|
|
|
else
|
|
|
|
"page-gutter right-sidebar-expanded"
|
|
|
|
end
|
2016-06-16 23:09:34 +05:30
|
|
|
elsif current_path?('builds#show')
|
|
|
|
"page-gutter build-sidebar right-sidebar-expanded"
|
2017-08-17 22:00:37 +05:30
|
|
|
elsif current_path?('wikis#show') ||
|
|
|
|
current_path?('wikis#edit') ||
|
|
|
|
current_path?('wikis#update') ||
|
|
|
|
current_path?('wikis#history') ||
|
|
|
|
current_path?('wikis#git_access')
|
|
|
|
"page-gutter wiki-sidebar right-sidebar-expanded"
|
2016-04-02 18:10:28 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
def nav_header_class
|
2016-06-22 15:30:34 +05:30
|
|
|
class_name = ''
|
|
|
|
class_name << " with-horizontal-nav" if defined?(nav) && nav
|
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
class_name
|
|
|
|
end
|
|
|
|
|
|
|
|
def layout_nav_class
|
2017-08-17 22:00:37 +05:30
|
|
|
class_name = ''
|
|
|
|
class_name << " page-with-layout-nav" if defined?(nav) && nav
|
|
|
|
class_name << " page-with-sub-nav" if content_for?(:sub_nav)
|
|
|
|
|
|
|
|
class_name
|
2016-06-02 11:05:42 +05:30
|
|
|
end
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
def nav_control_class
|
|
|
|
"nav-control" if current_user
|
2015-09-11 14:41:01 +05:30
|
|
|
end
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|