_project_filter.html.haml 2.31 KB
Newer Older
1
.side-filters
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
2
  = form_tag project_entities_path, method: 'get' do
3
4
    - if current_user
      %fieldset
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
5
        %ul.nav.nav-pills.nav-stacked
6
7
          %li{class: ("active" if params[:scope] == 'all')}
            = link_to project_filter_path(scope: 'all') do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
8
              Everyone's
9
10
              %span.pull-right
                = authorized_entities_count(current_user, entity, @project)
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
11
12
13
          %li{class: ("active" if params[:scope] == 'assigned-to-me')}
            = link_to project_filter_path(scope: 'assigned-to-me') do
              Assigned to me
14
15
              %span.pull-right
                = assigned_entities_count(current_user, entity, @project)
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
16
17
18
          %li{class: ("active" if params[:scope] == 'created-by-me')}
            = link_to project_filter_path(scope: 'created-by-me') do
              Created by me
19
20
              %span.pull-right
                = authored_entities_count(current_user, entity, @project)
21

22
    %fieldset
23
24
      %legend State
      %ul.nav.nav-pills
25
26
        %li{class: ("active" if params[:state] == 'opened')}
          = link_to project_filter_path(state: 'opened') do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
27
28
29
30
31
32
33
            Open
        %li{class: ("active" if params[:state] == 'closed')}
          = link_to project_filter_path(state: 'closed') do
            Closed
        %li{class: ("active" if params[:state] == 'all')}
          = link_to project_filter_path(state: 'all') do
            All
34

35
36
37
    - if defined?(labels)
      %fieldset
        %legend Labels
38
        %ul.nav.nav-pills.nav-stacked.nav-small.labels-filter
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
39
          - @project.labels.order_by_name.each do |label|
40
41
42
43
            %li{class: label_filter_class(label.name)}
              = link_to labels_filter_path(label.name) do
                = render_colored_label(label)
                - if selected_label?(label.name)
44
45
                  .pull-right
                    %i.icon-remove
46

47
48
49
50
51
        - if @project.labels.empty?
          .light-well
            Add first label to your issues
            %br
            or #{link_to 'generate', generate_project_labels_path(@project, redirect: redirect), method: :post} default set of labels
52

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
53
54
55
56
57
    %fieldset
      - if %w(state scope milestone_id assignee_id label_name).select { |k| params[k].present? }.any?
        = link_to project_entities_path, class: 'cgray pull-right' do
          %i.icon-remove
          %strong Clear filter
58
59