BigW Consortium Gitlab

_category.html.haml 2.63 KB
Newer Older
1
%ul.nav-links.search-filter
2 3 4
  - if @project
    %li{class: ("active" if @scope == 'blobs')}
      = link_to search_filter_path(scope: 'blobs') do
Phil Hughes committed
5 6 7
        Code
        %span.badge
          = @search_results.blobs_count
8 9
    %li{class: ("active" if @scope == 'issues')}
      = link_to search_filter_path(scope: 'issues') do
Phil Hughes committed
10 11 12
        Issues
        %span.badge
          = @search_results.issues_count
13 14
    %li{class: ("active" if @scope == 'merge_requests')}
      = link_to search_filter_path(scope: 'merge_requests') do
Phil Hughes committed
15 16 17
        Merge requests
        %span.badge
          = @search_results.merge_requests_count
18 19
    %li{class: ("active" if @scope == 'milestones')}
      = link_to search_filter_path(scope: 'milestones') do
Phil Hughes committed
20 21 22
        Milestones
        %span.badge
          = @search_results.milestones_count
23 24
    %li{class: ("active" if @scope == 'notes')}
      = link_to search_filter_path(scope: 'notes') do
Phil Hughes committed
25 26 27
        Comments
        %span.badge
          = @search_results.notes_count
28 29
    %li{class: ("active" if @scope == 'wiki_blobs')}
      = link_to search_filter_path(scope: 'wiki_blobs') do
Phil Hughes committed
30 31 32
        Wiki
        %span.badge
          = @search_results.wiki_blobs_count
33 34
    %li{class: ("active" if @scope == 'commits')}
      = link_to search_filter_path(scope: 'commits') do
Phil Hughes committed
35 36 37
        Commits
        %span.badge
          = @search_results.commits_count
38 39 40 41

  - elsif @show_snippets
    %li{class: ("active" if @scope == 'snippet_blobs')}
      = link_to search_filter_path(scope: 'snippet_blobs', snippets: true, group_id: nil, project_id: nil) do
Phil Hughes committed
42 43 44
        Snippet Contents
        %span.badge
          = @search_results.snippet_blobs_count
45 46
    %li{class: ("active" if @scope == 'snippet_titles')}
      = link_to search_filter_path(scope: 'snippet_titles', snippets: true, group_id: nil, project_id: nil) do
Phil Hughes committed
47 48 49
        Titles and Filenames
        %span.badge
          = @search_results.snippet_titles_count
50 51 52 53

  - else
    %li{class: ("active" if @scope == 'projects')}
      = link_to search_filter_path(scope: 'projects') do
Phil Hughes committed
54 55 56
        Projects
        %span.badge
          = @search_results.projects_count
57 58
    %li{class: ("active" if @scope == 'issues')}
      = link_to search_filter_path(scope: 'issues') do
Phil Hughes committed
59 60 61
        Issues
        %span.badge
          = @search_results.issues_count
62 63
    %li{class: ("active" if @scope == 'merge_requests')}
      = link_to search_filter_path(scope: 'merge_requests') do
Phil Hughes committed
64 65 66
        Merge requests
        %span.badge
          = @search_results.merge_requests_count
67 68
    %li{class: ("active" if @scope == 'milestones')}
      = link_to search_filter_path(scope: 'milestones') do
Phil Hughes committed
69 70 71
        Milestones
        %span.badge
          = @search_results.milestones_count