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

55 lines
1.1 KiB
Ruby
Raw Normal View History

2015-04-26 12:48:37 +05:30
module NavHelper
def nav_menu_collapsed?
cookies[:collapsed_nav] == 'true'
end
2015-09-11 14:41:01 +05:30
def nav_sidebar_class
2015-12-23 02:04:40 +05:30
if nav_menu_collapsed?
"sidebar-collapsed"
else
"sidebar-expanded"
end
end
def page_sidebar_class
2015-09-11 14:41:01 +05:30
if nav_menu_collapsed?
"page-sidebar-collapsed"
else
"page-sidebar-expanded"
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') ||
current_path?('issues#show')
if cookies[:collapsed_gutter] == 'true'
"page-gutter right-sidebar-collapsed"
else
"page-gutter right-sidebar-expanded"
end
end
end
2015-09-11 14:41:01 +05:30
def nav_header_class
2016-06-02 11:05:42 +05:30
class_name =
if nav_menu_collapsed?
"header-collapsed"
else
"header-expanded"
end
class_name += " with-horizontal-nav" if defined?(nav) && nav
class_name
end
def layout_nav_class
"page-with-layout-nav" if defined?(nav) && nav
end
def layout_dropdown_class
"controls-dropdown-visible" if current_user
2015-09-11 14:41:01 +05:30
end
2015-04-26 12:48:37 +05:30
end