summaryrefslogtreecommitdiff
path: root/app/views/shared/issuable/_nav.html.haml
blob: fb592c2b1e2448982457a8a5f51cae6689bb76ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
%ul.nav-links.issues-state-filters
  - if defined?(type) && type == :merge_requests
    - page_context_word = 'merge requests'
    - records = @all_merge_requests
  - else
    - page_context_word = 'issues'
    - records = @all_issues
  %li{class: ("active" if params[:state] == 'opened')}
    = link_to page_filter_path(state: 'opened', label: true), title: "Filter by #{page_context_word} that are currently opened." do
      #{state_filters_text_for(:opened, records)}

  - if defined?(type) && type == :merge_requests
    %li{class: ("active" if params[:state] == 'merged')}
      = link_to page_filter_path(state: 'merged', label: true), title: 'Filter by merge requests that are currently merged.' do
        #{state_filters_text_for(:merged, records)}

    %li{class: ("active" if params[:state] == 'closed')}
      = link_to page_filter_path(state: 'closed', label: true), title: 'Filter by merge requests that are currently closed and unmerged.' do
        #{state_filters_text_for(:closed, records)}
  - else
    %li{class: ("active" if params[:state] == 'closed')}
      = link_to page_filter_path(state: 'closed', label: true), title: 'Filter by issues that are currently closed.' do
        #{state_filters_text_for(:closed, records)}

  %li{class: ("active" if params[:state] == 'all')}
    = link_to page_filter_path(state: 'all', label: true), title: "Show all #{page_context_word}." do
      #{state_filters_text_for(:all, records)}