summaryrefslogtreecommitdiff
path: root/app/views/shared/issuable/_search_bar.html.haml
blob: d1e74cc771e2751835aee730fe788bae2e5c57ec (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
- type = local_assigns.fetch(:type)
- board = local_assigns.fetch(:board, nil)
- show_sorting_dropdown = local_assigns.fetch(:show_sorting_dropdown, true)
- disable_target_branch = local_assigns.fetch(:disable_target_branch, false)
- placeholder = local_assigns[:placeholder] || _('Search or filter results...')
- is_not_boards_modal_or_productivity_analytics = type != :boards_modal && type != :productivity_analytics
- block_css_class = is_not_boards_modal_or_productivity_analytics ? 'row-content-block second-block' : ''
- user_can_admin_list = board && can?(current_user, :admin_list, board.resource_parent)

.issues-filters{ class: ("w-100" if type == :boards_modal) }
  .issues-details-filters.filtered-search-block.d-flex.flex-column.flex-lg-row{ class: block_css_class, "v-pre" => type == :boards_modal }
    .d-flex.flex-column.flex-md-row.flex-grow-1.mb-lg-0.mb-md-2.mb-sm-0.w-100
      - if type == :boards
        = render "shared/boards/switcher", board: board
      = form_tag page_filter_path, method: :get, class: 'filter-form js-filter-form w-100' do
        - if params[:search].present?
          = hidden_field_tag :search, params[:search]
        - if @can_bulk_update
          .check-all-holder.d-none.d-sm-block.hidden
            = check_box_tag "check-all-issues", nil, false, class: "check-all-issues left"
        .issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row
          .filtered-search-box
            - if type != :boards_modal && type != :boards
              - text = tag.span(sprite_icon('history'), class: "d-md-none") + tag.span(_('Recent searches'), class: "d-none d-md-inline")
              = dropdown_tag(text,
                options: { wrapper_class: "filtered-search-history-dropdown-wrapper",
                toggle_class: "btn filtered-search-history-dropdown-toggle-button",
                dropdown_class: "filtered-search-history-dropdown",
                content_class: "filtered-search-history-dropdown-content" }) do
                .js-filtered-search-history-dropdown{ data: { full_path: search_history_storage_prefix } }
            .filtered-search-box-input-container.droplab-dropdown
              .scroll-container
                %ul.tokens-container.list-unstyled
                  %li.input-token
                    %input.form-control.filtered-search{ search_filter_input_options(type, placeholder) }
              #js-dropdown-hint.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown
                %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                  %li.filter-dropdown-item{ data: {hint: "#{'{{hint}}'}", tag: "#{'{{tag}}'}", action: "#{'{{hint === \'search\' ? \'submit\' : \'\' }}'}" } }
                    %button.btn.btn-link{ type: 'button' }
                      -# Encapsulate static class name `{{icon}}` inside #{} to bypass
                      -# haml lint's ClassAttributeWithStaticValue
                      %svg
                        %use{ 'xlink:href': "#{'{{icon}}'}" }
                      %span.js-filter-hint
                        {{formattedKey}}
              #js-dropdown-operator.filtered-search-input-dropdown-menu.dropdown-menu
                %ul.filter-dropdown{ data: { dropdown: true, dynamic: true } }
                  %li.filter-dropdown-item{ data: { value: "{{ title }}" } }
                    %button.btn.btn-link{ type: 'button' }
                      {{ title }}
                      %span.btn-helptext
                        {{ help }}
              #js-dropdown-author.filtered-search-input-dropdown-menu.dropdown-menu
                - if current_user
                  %ul{ data: { dropdown: true } }
                    = render 'shared/issuable/user_dropdown_item',
                      user: current_user
                %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                  = render 'shared/issuable/user_dropdown_item',
                    user: User.new(username: '{{username}}', name: '{{name}}'),
                    avatar: { lazy: true, url: '{{avatar_url}}' }
              #js-dropdown-assignee.filtered-search-input-dropdown-menu.dropdown-menu
                %ul{ data: { dropdown: true } }
                  %li.filter-dropdown-item{ data: { value: 'None' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('None')
                  %li.filter-dropdown-item{ data: { value: 'Any' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Any')
                  %li.divider.droplab-item-ignore
                  - if current_user
                    = render 'shared/issuable/user_dropdown_item',
                      user: current_user
                %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                  = render 'shared/issuable/user_dropdown_item',
                    user: User.new(username: '{{username}}', name: '{{name}}'),
                    avatar: { lazy: true, url: '{{avatar_url}}' }
              #js-dropdown-reviewer.filtered-search-input-dropdown-menu.dropdown-menu
                %ul{ data: { dropdown: true } }
                  %li.filter-dropdown-item{ data: { value: 'None' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('None')
                  %li.filter-dropdown-item{ data: { value: 'Any' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Any')
                  %li.divider.droplab-item-ignore
                  - if current_user
                    = render 'shared/issuable/user_dropdown_item',
                      user: current_user
                %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                  = render 'shared/issuable/user_dropdown_item',
                    user: User.new(username: '{{username}}', name: '{{name}}'),
                    avatar: { lazy: true, url: '{{avatar_url}}' }
              = render_if_exists 'shared/issuable/approver_dropdown'
              = render_if_exists 'shared/issuable/approved_by_dropdown'
              #js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu
                %ul{ data: { dropdown: true } }
                  %li.filter-dropdown-item{ data: { value: 'None' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('None')
                  %li.filter-dropdown-item{ data: { value: 'Any' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Any')
                  %li.filter-dropdown-item{ data: { value: 'Upcoming' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Upcoming')
                  %li.filter-dropdown-item{ data: { value: 'Started' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Started')
                  %li.divider.droplab-item-ignore
                %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                  %li.filter-dropdown-item
                    %button.btn.btn-link.js-data-value{ type: 'button' }
                      {{title}}
              = render_if_exists 'shared/issuable/filter_iteration', type: type
              #js-dropdown-release.filtered-search-input-dropdown-menu.dropdown-menu
                %ul{ data: { dropdown: true } }
                  %li.filter-dropdown-item{ data: { value: 'None' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('None')
                  %li.filter-dropdown-item{ data: { value: 'Any' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Any')
                  %li.divider.droplab-item-ignore
                %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                  %li.filter-dropdown-item
                    %button.btn.btn-link.js-data-value{ type: 'button' }
                      {{title}}
              #js-dropdown-label.filtered-search-input-dropdown-menu.dropdown-menu
                %ul{ data: { dropdown: true } }
                  %li.filter-dropdown-item{ data: { value: 'None' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('None')
                  %li.filter-dropdown-item{ data: { value: 'Any' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Any')
                  %li.divider.droplab-item-ignore
                %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                  %li.filter-dropdown-item
                    %button.btn.btn-link{ type: 'button' }
                      %span.dropdown-label-box{ style: 'background: {{color}}' }
                      %span.label-title.js-data-value
                        {{title}}
              #js-dropdown-my-reaction.filtered-search-input-dropdown-menu.dropdown-menu
                %ul{ data: { dropdown: true } }
                  %li.filter-dropdown-item{ data: { value: 'None' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('None')
                  %li.filter-dropdown-item{ data: { value: 'Any' } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Any')
                  %li.divider.droplab-item-ignore
                %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                  %li.filter-dropdown-item
                    %button.btn.btn-link{ type: 'button' }
                      %gl-emoji
                      %span.js-data-value.gl-ml-3
                        {{name}}
              #js-dropdown-wip.filtered-search-input-dropdown-menu.dropdown-menu
                %ul.filter-dropdown{ data: { dropdown: true } }
                  %li.filter-dropdown-item{ data: { value: 'yes', capitalize: true } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Yes')
                  %li.filter-dropdown-item{ data: { value: 'no', capitalize: true } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('No')
              #js-dropdown-confidential.filtered-search-input-dropdown-menu.dropdown-menu
                %ul.filter-dropdown{ data: { dropdown: true } }
                  %li.filter-dropdown-item{ data: { value: 'yes', capitalize: true } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('Yes')
                  %li.filter-dropdown-item{ data: { value: 'no', capitalize: true } }
                    %button.btn.btn-link{ type: 'button' }
                      = _('No')
              - unless disable_target_branch
                #js-dropdown-target-branch.filtered-search-input-dropdown-menu.dropdown-menu
                  %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                    %li.filter-dropdown-item
                      %button.btn.btn-link.js-data-value.monospace
                        {{title}}
              #js-dropdown-environment.filtered-search-input-dropdown-menu.dropdown-menu
                %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
                  %li.filter-dropdown-item
                    %button.btn.btn-link.js-data-value{ type: 'button' }
                      {{title}}

              = render_if_exists 'shared/issuable/filter_weight', type: type

              = render_if_exists 'shared/issuable/filter_epic', type: type

            %button.clear-search.hidden{ type: 'button' }
              = sprite_icon('close', size: 16, css_class: 'clear-search-icon')
    .filter-dropdown-container.d-flex.flex-column.flex-md-row
      - if type == :boards
        #js-board-labels-toggle
        - if current_user
          #js-board-epics-swimlanes-toggle
        .js-board-config{ data: { can_admin_list: user_can_admin_list, has_scope: board.scoped? } }
        - if user_can_admin_list
          - if Feature.enabled?(:board_new_list, board.resource_parent, default_enabled: :yaml)
            .js-create-column-trigger{ data: board_list_data }
          - else
            = render 'shared/issuable/board_create_list_dropdown', board: board
          - if @project
            #js-add-issues-btn{ data: { can_admin_list: can?(current_user, :admin_list, @project) } }
        #js-toggle-focus-btn
      - elsif is_not_boards_modal_or_productivity_analytics && show_sorting_dropdown
        = render 'shared/issuable/sort_dropdown'