debian-mirror-gitlab/app/views/shared/issuable/_search_bar.html.haml

215 lines
13 KiB
Text
Raw Normal View History

2017-08-17 22:00:37 +05:30
- type = local_assigns.fetch(:type)
2018-11-08 19:23:39 +05:30
- board = local_assigns.fetch(:board, nil)
2020-03-13 15:44:24 +05:30
- show_sorting_dropdown = local_assigns.fetch(:show_sorting_dropdown, true)
2021-01-03 14:25:43 +05:30
- disable_target_branch = local_assigns.fetch(:disable_target_branch, false)
2020-05-24 23:13:21 +05:30
- placeholder = local_assigns[:placeholder] || _('Search or filter results...')
2021-04-29 21:17:54 +05:30
- block_css_class = type != :productivity_analytics ? 'row-content-block second-block' : ''
- is_epic_board = board&.to_type == "EpicBoard"
- if is_epic_board
2021-04-17 20:07:23 +05:30
- user_can_admin_list = can?(current_user, :admin_epic_board_list, board.resource_parent)
- elsif board
- user_can_admin_list = can?(current_user, :admin_issue_board_list, board.resource_parent)
2017-08-17 22:00:37 +05:30
2021-04-29 21:17:54 +05:30
.issues-filters
.issues-details-filters.filtered-search-block.d-flex.flex-column.flex-lg-row{ class: block_css_class }
2020-01-01 13:55:28 +05:30
.d-flex.flex-column.flex-md-row.flex-grow-1.mb-lg-0.mb-md-2.mb-sm-0.w-100
2019-12-26 22:10:19 +05:30
- 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
2021-06-08 01:23:25 +05:30
- checkbox_id = 'check-all-issues'
%label.gl-sr-only{ for: checkbox_id }= _('Select all')
= check_box_tag checkbox_id, nil, false, class: "check-all-issues left"
2021-09-04 01:27:46 +05:30
- if is_epic_board
2021-06-08 01:23:25 +05:30
#js-board-filtered-search{ data: { full_path: @group&.full_path } }
2021-04-17 20:07:23 +05:30
- else
.issues-other-filters.filtered-search-wrapper.d-flex.flex-column.flex-md-row
.filtered-search-box
2021-04-29 21:17:54 +05:30
- if type != :boards
2021-04-17 20:07:23 +05:30
- 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",
2021-04-29 21:17:54 +05:30
toggle_class: "gl-button btn btn-default filtered-search-history-dropdown-toggle-button",
2021-04-17 20:07:23 +05:30
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\' : \'\' }}'}" } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
-# 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 }}" } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
{{ title }}
%span.btn-helptext
{{ help }}
#js-dropdown-author.filtered-search-input-dropdown-menu.dropdown-menu
2019-12-26 22:10:19 +05:30
- if current_user
2021-04-17 20:07:23 +05:30
%ul{ data: { dropdown: true } }
= render 'shared/issuable/user_dropdown_item',
user: current_user
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
2019-12-26 22:10:19 +05:30
= render 'shared/issuable/user_dropdown_item',
2021-04-17 20:07:23 +05:30
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' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('None')
%li.filter-dropdown-item{ data: { value: 'Any' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('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' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('None')
%li.filter-dropdown-item{ data: { value: 'Any' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('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 } }
2021-02-22 17:27:13 +05:30
= render 'shared/issuable/user_dropdown_item',
2021-04-17 20:07:23 +05:30
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' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('None')
%li.filter-dropdown-item{ data: { value: 'Any' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('Any')
%li.filter-dropdown-item{ data: { value: 'Upcoming' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('Upcoming')
%li.filter-dropdown-item{ data: { value: 'Started' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('Started')
%li.divider.droplab-item-ignore
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link.js-data-value{ type: 'button' }
2021-04-17 20:07:23 +05:30
{{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' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('None')
%li.filter-dropdown-item{ data: { value: 'Any' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('Any')
%li.divider.droplab-item-ignore
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link.js-data-value{ type: 'button' }
2019-12-26 22:10:19 +05:30
{{title}}
2021-04-17 20:07:23 +05:30
#js-dropdown-label.filtered-search-input-dropdown-menu.dropdown-menu
%ul{ data: { dropdown: true } }
%li.filter-dropdown-item{ data: { value: 'None' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('None')
%li.filter-dropdown-item{ data: { value: 'Any' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('Any')
%li.divider.droplab-item-ignore
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
%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' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('None')
%li.filter-dropdown-item{ data: { value: 'Any' } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('Any')
%li.divider.droplab-item-ignore
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
%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 } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('Yes')
%li.filter-dropdown-item{ data: { value: 'no', capitalize: true } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('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 } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('Yes')
%li.filter-dropdown-item{ data: { value: 'no', capitalize: true } }
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link{ type: 'button' }
2021-04-17 20:07:23 +05:30
= _('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
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link.js-data-value.monospace
2021-04-17 20:07:23 +05:30
{{title}}
#js-dropdown-environment.filtered-search-input-dropdown-menu.dropdown-menu
2021-01-03 14:25:43 +05:30
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item
2021-04-29 21:17:54 +05:30
%button.gl-button.btn.btn-link.js-data-value{ type: 'button' }
2021-01-03 14:25:43 +05:30
{{title}}
2018-11-08 19:23:39 +05:30
2021-04-17 20:07:23 +05:30
= render_if_exists 'shared/issuable/filter_weight', type: type
2018-11-08 19:23:39 +05:30
2021-04-17 20:07:23 +05:30
= render_if_exists 'shared/issuable/filter_epic', type: type
2020-04-08 14:13:33 +05:30
2021-04-17 20:07:23 +05:30
%button.clear-search.hidden{ type: 'button' }
= sprite_icon('close', size: 16, css_class: 'clear-search-icon')
2019-12-26 22:10:19 +05:30
.filter-dropdown-container.d-flex.flex-column.flex-md-row
- if type == :boards
2020-01-01 13:55:28 +05:30
#js-board-labels-toggle
2021-03-11 19:13:27 +05:30
- if current_user
#js-board-epics-swimlanes-toggle
2021-04-17 20:07:23 +05:30
.js-board-config{ data: { can_admin_list: user_can_admin_list.to_s, has_scope: board.scoped?.to_s } }
2019-12-26 22:10:19 +05:30
- if user_can_admin_list
2021-04-17 20:07:23 +05:30
- if Feature.enabled?(:board_new_list, board.resource_parent, default_enabled: :yaml) || board.to_type == "EpicBoard"
2021-03-11 19:13:27 +05:30
.js-create-column-trigger{ data: board_list_data }
- else
= render 'shared/issuable/board_create_list_dropdown', board: board
2019-12-26 22:10:19 +05:30
#js-toggle-focus-btn
2021-04-29 21:17:54 +05:30
- elsif type != :productivity_analytics && show_sorting_dropdown
2019-12-26 22:10:19 +05:30
= render 'shared/issuable/sort_dropdown'