summaryrefslogtreecommitdiff
path: root/app/views/shared/issuable/_nav.html.haml
blob: 5527a2f889a4699744a66e7b187729e5181e5b4e (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
- type = local_assigns.fetch(:type, :issues)
- page_context_word = type.to_s.humanize(capitalize: false)
- issuables = @issues || @merge_requests

%ul.nav-links.issues-state-filters
  %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
      #{issuables_state_counter_text(type, :opened)}

  - if 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
        #{issuables_state_counter_text(type, :merged)}

    %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
        #{issuables_state_counter_text(type, :closed)}
  - 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
        #{issuables_state_counter_text(type, :closed)}

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