2015-01-30 14:23:35 -05:00
|
|
|
module NavHelper
|
2017-07-31 04:07:51 -04:00
|
|
|
def page_with_sidebar_class
|
|
|
|
class_name = page_gutter_class
|
2017-10-20 18:57:24 -04:00
|
|
|
class_name << 'page-with-contextual-sidebar' if defined?(@left_sidebar) && @left_sidebar
|
2017-09-06 06:58:24 -04:00
|
|
|
class_name << 'page-with-icon-sidebar' if collapsed_sidebar? && @left_sidebar
|
2017-07-31 04:07:51 -04:00
|
|
|
|
|
|
|
class_name
|
|
|
|
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') ||
|
2017-06-13 18:12:31 -04:00
|
|
|
current_path?('projects/merge_requests/conflicts#show') ||
|
2017-03-23 16:53:51 -04:00
|
|
|
current_path?('issues#show') ||
|
|
|
|
current_path?('milestones#show')
|
2016-01-28 18:26:47 -05:00
|
|
|
if cookies[:collapsed_gutter] == 'true'
|
2017-07-31 04:07:51 -04:00
|
|
|
%w[page-gutter right-sidebar-collapsed]
|
2016-01-28 18:26:47 -05:00
|
|
|
else
|
2017-07-31 04:07:51 -04:00
|
|
|
%w[page-gutter right-sidebar-expanded]
|
2016-01-28 18:26:47 -05:00
|
|
|
end
|
2017-06-08 08:21:03 -04:00
|
|
|
elsif current_path?('jobs#show')
|
2017-07-31 04:07:51 -04:00
|
|
|
%w[page-gutter build-sidebar right-sidebar-expanded]
|
2017-10-30 04:21:38 -04:00
|
|
|
elsif current_controller?('wikis') && current_action?('show', 'create', 'edit', 'update', 'history', 'git_access')
|
2017-07-31 04:07:51 -04:00
|
|
|
%w[page-gutter wiki-sidebar right-sidebar-expanded]
|
|
|
|
else
|
|
|
|
[]
|
2016-01-27 17:38:19 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-05-16 15:58:15 -04:00
|
|
|
def nav_control_class
|
|
|
|
"nav-control" if current_user
|
|
|
|
end
|
2017-08-10 16:13:38 -04:00
|
|
|
|
|
|
|
def user_dropdown_class
|
|
|
|
class_names = []
|
|
|
|
class_names << 'header-user-dropdown-toggle'
|
|
|
|
class_names << 'impersonated-user' if session[:impersonator_id]
|
|
|
|
|
|
|
|
class_names
|
|
|
|
end
|
2015-01-30 14:23:35 -05:00
|
|
|
end
|