BigW Consortium Gitlab

nav_helper.rb 1.32 KB
Newer Older
1
module NavHelper
2
  def page_gutter_class
3
    if current_path?('merge_requests#show') ||
4 5 6 7 8
        current_path?('merge_requests#diffs') ||
        current_path?('merge_requests#commits') ||
        current_path?('merge_requests#builds') ||
        current_path?('merge_requests#conflicts') ||
        current_path?('merge_requests#pipelines') ||
9 10
        current_path?('issues#show') ||
        current_path?('milestones#show')
11 12 13 14 15
      if cookies[:collapsed_gutter] == 'true'
        "page-gutter right-sidebar-collapsed"
      else
        "page-gutter right-sidebar-expanded"
      end
Phil Hughes committed
16 17
    elsif current_path?('builds#show')
      "page-gutter build-sidebar right-sidebar-expanded"
18
    elsif current_path?('wikis#show') ||
19
        current_path?('wikis#edit') ||
Dongqing Hu committed
20
        current_path?('wikis#update') ||
21 22
        current_path?('wikis#history') ||
        current_path?('wikis#git_access')
23
      "page-gutter wiki-sidebar right-sidebar-expanded"
24 25 26
    end
  end

27
  def nav_header_class
Phil Hughes committed
28 29
    class_name = ''
    class_name << " with-horizontal-nav" if defined?(nav) && nav
30

31
    class_name
32
  end
33 34

  def layout_nav_class
35 36 37 38 39
    class_name = ''
    class_name << " page-with-layout-nav" if defined?(nav) && nav
    class_name << " page-with-sub-nav" if content_for?(:sub_nav)

    class_name
40 41
  end

42 43 44
  def nav_control_class
    "nav-control" if current_user
  end
45
end