_nav.html.haml 1.36 KB
Newer Older
1 2 3 4
- type = local_assigns.fetch(:type, :issues)
- page_context_word = type.to_s.humanize(capitalize: false)
- issuables = @issues || @merge_requests

5 6
%ul.nav-links.issues-state-filters
  %li{class: ("active" if params[:state] == 'opened')}
Arinde Eniola's avatar
Arinde Eniola committed
7
    = link_to page_filter_path(state: 'opened', label: true), title: "Filter by #{page_context_word} that are currently opened." do
8
      #{issuables_state_counter_text(type, :opened)}
9

10
  - if type == :merge_requests
11
    %li{class: ("active" if params[:state] == 'merged')}
Arinde Eniola's avatar
Arinde Eniola committed
12
      = link_to page_filter_path(state: 'merged', label: true), title: 'Filter by merge requests that are currently merged.' do
13
        #{issuables_state_counter_text(type, :merged)}
14 15

    %li{class: ("active" if params[:state] == 'closed')}
Arinde Eniola's avatar
Arinde Eniola committed
16
      = link_to page_filter_path(state: 'closed', label: true), title: 'Filter by merge requests that are currently closed and unmerged.' do
17
        #{issuables_state_counter_text(type, :closed)}
18 19
  - else
    %li{class: ("active" if params[:state] == 'closed')}
Arinde Eniola's avatar
Arinde Eniola committed
20
      = link_to page_filter_path(state: 'closed', label: true), title: 'Filter by issues that are currently closed.' do
21
        #{issuables_state_counter_text(type, :closed)}
22 23

  %li{class: ("active" if params[:state] == 'all')}
Arinde Eniola's avatar
Arinde Eniola committed
24
    = link_to page_filter_path(state: 'all', label: true), title: "Show all #{page_context_word}." do
25
      #{issuables_state_counter_text(type, :all)}