2015-01-30 19:23:35 +00:00
|
|
|
module NavHelper
|
|
|
|
def nav_menu_collapsed?
|
|
|
|
cookies[:collapsed_nav] == 'true'
|
|
|
|
end
|
2015-04-22 13:48:39 +00:00
|
|
|
|
|
|
|
def nav_sidebar_class
|
2015-12-02 13:05:10 +00:00
|
|
|
if nav_menu_collapsed?
|
|
|
|
"sidebar-collapsed"
|
|
|
|
else
|
|
|
|
"sidebar-expanded"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def page_sidebar_class
|
2015-04-22 13:48:39 +00:00
|
|
|
if nav_menu_collapsed?
|
|
|
|
"page-sidebar-collapsed"
|
|
|
|
else
|
|
|
|
"page-sidebar-expanded"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-01-27 22:38:19 +00:00
|
|
|
def page_gutter_class
|
2016-02-15 14:19:23 +00:00
|
|
|
if current_path?('merge_requests#show') ||
|
|
|
|
current_path?('merge_requests#diffs') ||
|
|
|
|
current_path?('merge_requests#commits') ||
|
2016-02-04 19:56:25 +00:00
|
|
|
current_path?('issues#show')
|
2016-01-28 23:26:47 +00:00
|
|
|
if cookies[:collapsed_gutter] == 'true'
|
|
|
|
"page-gutter right-sidebar-collapsed"
|
|
|
|
else
|
|
|
|
"page-gutter right-sidebar-expanded"
|
|
|
|
end
|
2016-01-27 22:38:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-04-22 13:48:39 +00:00
|
|
|
def nav_header_class
|
|
|
|
if nav_menu_collapsed?
|
|
|
|
"header-collapsed"
|
|
|
|
else
|
|
|
|
"header-expanded"
|
|
|
|
end
|
|
|
|
end
|
2015-01-30 19:23:35 +00:00
|
|
|
end
|