BigW Consortium Gitlab

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

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

30
    class_name
31
  end
32 33

  def layout_nav_class
34 35 36 37 38
    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
39 40
  end

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