summaryrefslogtreecommitdiff
path: root/app/views/shared/issuable/_nav.html.haml
blob: cf7ba52d840c3cd7b40df84d09f792fab8469897 (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
- type = local_assigns.fetch(:type, :issues)
- page_context_word = type.to_s.humanize(capitalize: false)
- issuables = @issues || @merge_requests
- closed_title = 'Filter by issues that are currently closed.'

%ul.nav-links.issues-state-filters
  %li{ class: active_when(params[:state] == 'opened') }>
    %button.btn.btn-link{ id: 'state-opened', title: "Filter by #{page_context_word} that are currently opened.", type: 'button', data: { state: 'opened' } }
      #{issuables_state_counter_text(type, :opened)}

  - if type == :merge_requests
    %li{ class: active_when(params[:state] == 'merged') }>
      %button.btn.btn-link{ id: 'state-merged', title: 'Filter by merge requests that are currently merged.', type: 'button', data: { state: 'merged' } }
        #{issuables_state_counter_text(type, :merged)}

    - closed_title = 'Filter by merge requests that are currently closed and unmerged.'

  %li{ class: active_when(params[:state] == 'closed') }>
    %button.btn.btn-link{ id: 'state-closed', title: closed_title, type: 'button', data: { state: 'closed' } }
      #{issuables_state_counter_text(type, :closed)}

  %li{ class: active_when(params[:state] == 'all') }>
    %button.btn.btn-link{ id: 'state-all', title: "Show all #{page_context_word}.", type: 'button', data: { state: 'all' } }
      #{issuables_state_counter_text(type, :all)}