debian-mirror-gitlab/app/helpers/nav_helper.rb

49 lines
1.2 KiB
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
module NavHelper
2015-12-23 02:04:40 +05:30
def page_sidebar_class
2016-06-22 15:30:34 +05:30
if pinned_nav?
"page-sidebar-expanded page-sidebar-pinned"
2015-09-11 14:41:01 +05:30
end
end
2016-04-02 18:10:28 +05:30
def page_gutter_class
if current_path?('merge_requests#show') ||
current_path?('merge_requests#diffs') ||
current_path?('merge_requests#commits') ||
current_path?('merge_requests#builds') ||
2016-09-13 17:45:13 +05:30
current_path?('merge_requests#conflicts') ||
2016-09-29 09:46:39 +05:30
current_path?('merge_requests#pipelines') ||
2016-04-02 18:10:28 +05:30
current_path?('issues#show')
if cookies[:collapsed_gutter] == 'true'
"page-gutter right-sidebar-collapsed"
else
"page-gutter right-sidebar-expanded"
end
elsif current_path?('builds#show')
"page-gutter build-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
if pinned_nav?
2016-09-29 09:46:39 +05:30
class_name << " header-sidebar-expanded header-sidebar-pinned"
2016-06-22 15:30:34 +05:30
end
2016-06-02 11:05:42 +05:30
class_name
end
def layout_nav_class
"page-with-layout-nav" if defined?(nav) && nav
end
def nav_control_class
"nav-control" if current_user
2015-09-11 14:41:01 +05:30
end
2016-06-22 15:30:34 +05:30
def pinned_nav?
cookies[:pin_nav] == 'true'
end
2015-04-26 12:48:37 +05:30
end