BigW Consortium Gitlab

nav_helper.rb 900 Bytes
Newer Older
1 2 3 4
module NavHelper
  def nav_menu_collapsed?
    cookies[:collapsed_nav] == 'true'
  end
5 6

  def nav_sidebar_class
7 8 9 10 11 12 13 14
    if nav_menu_collapsed?
      "sidebar-collapsed"
    else
      "sidebar-expanded"
    end
  end

  def page_sidebar_class
15 16 17 18 19 20 21
    if nav_menu_collapsed?
      "page-sidebar-collapsed"
    else
      "page-sidebar-expanded"
    end
  end

22
  def page_gutter_class
23 24 25
    if current_path?('merge_requests#show') ||
      current_path?('merge_requests#diffs') ||
      current_path?('merge_requests#commits') ||
26
      current_path?('merge_requests#builds') ||
27
      current_path?('issues#show')
28 29 30 31 32
      if cookies[:collapsed_gutter] == 'true'
        "page-gutter right-sidebar-collapsed"
      else
        "page-gutter right-sidebar-expanded"
      end
33 34 35
    end
  end

36 37 38 39 40 41 42
  def nav_header_class
    if nav_menu_collapsed?
      "header-collapsed"
    else
      "header-expanded"
    end
  end
43
end