2015-01-30 14:23:35 -05:00
|
|
|
module NavHelper
|
2015-12-02 08:05:10 -05:00
|
|
|
def page_sidebar_class
|
2016-06-15 12:23:49 -04:00
|
|
|
if pinned_nav?
|
|
|
|
"page-sidebar-expanded page-sidebar-pinned"
|
2015-04-22 09:48:39 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-01-27 17:38:19 -05:00
|
|
|
def page_gutter_class
|
2016-02-15 09:19:23 -05:00
|
|
|
if current_path?('merge_requests#show') ||
|
2016-12-15 17:14:20 -05:00
|
|
|
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')
|
2016-01-28 18:26:47 -05:00
|
|
|
if cookies[:collapsed_gutter] == 'true'
|
|
|
|
"page-gutter right-sidebar-collapsed"
|
|
|
|
else
|
|
|
|
"page-gutter right-sidebar-expanded"
|
|
|
|
end
|
2016-04-20 05:11:22 -04:00
|
|
|
elsif current_path?('builds#show')
|
|
|
|
"page-gutter build-sidebar right-sidebar-expanded"
|
2016-11-14 16:33:21 -05:00
|
|
|
elsif current_path?('wikis#show') ||
|
2016-12-15 17:14:20 -05:00
|
|
|
current_path?('wikis#edit') ||
|
|
|
|
current_path?('wikis#history') ||
|
|
|
|
current_path?('wikis#git_access')
|
2016-11-14 16:33:21 -05:00
|
|
|
"page-gutter wiki-sidebar right-sidebar-expanded"
|
2016-01-27 17:38:19 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-04-22 09:48:39 -04:00
|
|
|
def nav_header_class
|
2016-06-15 13:33:18 -04:00
|
|
|
class_name = ''
|
|
|
|
class_name << " with-horizontal-nav" if defined?(nav) && nav
|
2016-06-15 12:23:49 -04:00
|
|
|
|
|
|
|
if pinned_nav?
|
2016-09-02 11:34:04 -04:00
|
|
|
class_name << " header-sidebar-expanded header-sidebar-pinned"
|
2016-06-15 12:23:49 -04:00
|
|
|
end
|
|
|
|
|
2016-05-03 12:44:55 -04:00
|
|
|
class_name
|
2015-04-22 09:48:39 -04:00
|
|
|
end
|
2016-05-13 12:12:49 -04:00
|
|
|
|
|
|
|
def layout_nav_class
|
|
|
|
"page-with-layout-nav" if defined?(nav) && nav
|
|
|
|
end
|
|
|
|
|
2016-05-16 15:58:15 -04:00
|
|
|
def nav_control_class
|
|
|
|
"nav-control" if current_user
|
|
|
|
end
|
2016-06-15 12:23:49 -04:00
|
|
|
|
|
|
|
def pinned_nav?
|
|
|
|
cookies[:pin_nav] == 'true'
|
|
|
|
end
|
2015-01-30 14:23:35 -05:00
|
|
|
end
|