Module: NavHelper

Defined in:
app/helpers/nav_helper.rb

Instance Method Summary collapse

Instance Method Details


36
37
38
39
40
41
42
43
44
45
# File 'app/helpers/nav_helper.rb', line 36

def nav_header_class
  class_name =
    if nav_menu_collapsed?
      "header-collapsed"
    else
      "header-expanded"
    end
  class_name += " with-horizontal-nav" if defined?(nav) && nav
  class_name
end

2
3
4
# File 'app/helpers/nav_helper.rb', line 2

def nav_menu_collapsed?
  cookies[:collapsed_nav] == 'true'
end

6
7
8
9
10
11
12
# File 'app/helpers/nav_helper.rb', line 6

def nav_sidebar_class
  if nav_menu_collapsed?
    "sidebar-collapsed"
  else
    "sidebar-expanded"
  end
end

#page_gutter_classObject


22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/helpers/nav_helper.rb', line 22

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

#page_sidebar_classObject


14
15
16
17
18
19
20
# File 'app/helpers/nav_helper.rb', line 14

def page_sidebar_class
  if nav_menu_collapsed?
    "page-sidebar-collapsed"
  else
    "page-sidebar-expanded"
  end
end