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

160 lines
8.6 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)
2017-08-17 22:00:37 +05:30
- block_css_class = type != :boards_modal ? 'row-content-block second-block' : ''
2018-11-08 19:23:39 +05:30
- user_can_admin_list = board && can?(current_user, :admin_list, board.parent)
2017-08-17 22:00:37 +05:30
.issues-filters
.issues-details-filters.filtered-search-block{ class: block_css_class, "v-pre" => type == :boards_modal }
2018-11-08 19:23:39 +05:30
- if type == :boards
2019-02-15 15:39:39 +05:30
= render_if_exists "shared/boards/switcher", board: board
= form_tag page_filter_path, method: :get, class: 'filter-form js-filter-form' do
2017-08-17 22:00:37 +05:30
- if params[:search].present?
= hidden_field_tag :search, params[:search]
2017-09-10 17:25:29 +05:30
- if @can_bulk_update
2019-02-15 15:39:39 +05:30
.check-all-holder.d-none.d-sm-block.hidden
2017-09-10 17:25:29 +05:30
= check_box_tag "check-all-issues", nil, false, class: "check-all-issues left"
2017-08-17 22:00:37 +05:30
.issues-other-filters.filtered-search-wrapper
.filtered-search-box
- if type != :boards_modal && type != :boards
2017-09-10 17:25:29 +05:30
= dropdown_tag(custom_icon('icon_history'),
2017-08-17 22:00:37 +05:30
options: { wrapper_class: "filtered-search-history-dropdown-wrapper",
toggle_class: "filtered-search-history-dropdown-toggle-button",
dropdown_class: "filtered-search-history-dropdown",
content_class: "filtered-search-history-dropdown-content",
title: "Recent searches" }) do
2019-02-15 15:39:39 +05:30
.js-filtered-search-history-dropdown{ data: { full_path: search_history_storage_prefix } }
2017-09-10 17:25:29 +05:30
.filtered-search-box-input-container.droplab-dropdown
2017-08-17 22:00:37 +05:30
.scroll-container
%ul.tokens-container.list-unstyled
%li.input-token
2017-09-10 17:25:29 +05:30
%input.form-control.filtered-search{ search_filter_input_options(type) }
2017-08-17 22:00:37 +05:30
#js-dropdown-hint.filtered-search-input-dropdown-menu.dropdown-menu.hint-dropdown
%ul{ data: { dropdown: true } }
%li.filter-dropdown-item{ data: { action: 'submit' } }
2018-12-05 23:21:45 +05:30
%button.btn.btn-link{ type: 'button' }
= sprite_icon('search')
2017-08-17 22:00:37 +05:30
%span
2018-12-13 13:39:08 +05:30
= _('Press Enter or click to search')
2017-08-17 22:00:37 +05:30
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item
2018-12-05 23:21:45 +05:30
%button.btn.btn-link{ type: 'button' }
2017-08-17 22:00:37 +05:30
-# Encapsulate static class name `{{icon}}` inside #{} to bypass
-# haml lint's ClassAttributeWithStaticValue
2018-12-05 23:21:45 +05:30
%svg
%use{ 'xlink:href': "#{'{{icon}}'}" }
2017-08-17 22:00:37 +05:30
%span.js-filter-hint
{{hint}}
%span.js-filter-tag.dropdown-light-content
{{tag}}
2017-09-10 17:25:29 +05:30
#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
2017-08-17 22:00:37 +05:30
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
2017-09-10 17:25:29 +05:30
= 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
2017-08-17 22:00:37 +05:30
%ul{ data: { dropdown: true } }
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'None' } }
2018-12-05 23:21:45 +05:30
%button.btn.btn-link{ type: 'button' }
2018-12-13 13:39:08 +05:30
= _('None')
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'Any' } }
2018-12-13 13:39:08 +05:30
%button.btn.btn-link{ type: 'button' }
= _('Any')
2018-03-17 18:26:18 +05:30
%li.divider.droplab-item-ignore
2017-09-10 17:25:29 +05:30
- if current_user
= render 'shared/issuable/user_dropdown_item',
user: current_user
2017-08-17 22:00:37 +05:30
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
2017-09-10 17:25:29 +05:30
= render 'shared/issuable/user_dropdown_item',
user: User.new(username: '{{username}}', name: '{{name}}'),
avatar: { lazy: true, url: '{{avatar_url}}' }
2019-05-18 00:54:41 +05:30
= render_if_exists 'shared/issuable/approver_dropdown'
2017-09-10 17:25:29 +05:30
#js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu
2017-08-17 22:00:37 +05:30
%ul{ data: { dropdown: true } }
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'None' } }
2018-12-05 23:21:45 +05:30
%button.btn.btn-link{ type: 'button' }
2018-12-13 13:39:08 +05:30
= _('None')
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'Any' } }
2018-12-13 13:39:08 +05:30
%button.btn.btn-link{ type: 'button' }
= _('Any')
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'Upcoming' } }
2018-12-05 23:21:45 +05:30
%button.btn.btn-link{ type: 'button' }
2018-12-13 13:39:08 +05:30
= _('Upcoming')
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'Started' } }
2018-12-05 23:21:45 +05:30
%button.btn.btn-link{ type: 'button' }
2018-12-13 13:39:08 +05:30
= _('Started')
2018-03-17 18:26:18 +05:30
%li.divider.droplab-item-ignore
2017-08-17 22:00:37 +05:30
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item
2018-12-05 23:21:45 +05:30
%button.btn.btn-link.js-data-value{ type: 'button' }
2017-08-17 22:00:37 +05:30
{{title}}
2017-09-10 17:25:29 +05:30
#js-dropdown-label.filtered-search-input-dropdown-menu.dropdown-menu
2017-08-17 22:00:37 +05:30
%ul{ data: { dropdown: true } }
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'None' } }
2018-12-05 23:21:45 +05:30
%button.btn.btn-link{ type: 'button' }
2019-02-15 15:39:39 +05:30
= _('None')
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'Any' } }
2019-02-15 15:39:39 +05:30
%button.btn.btn-link{ type: 'button' }
= _('Any')
2018-03-17 18:26:18 +05:30
%li.divider.droplab-item-ignore
2017-08-17 22:00:37 +05:30
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item
2018-12-05 23:21:45 +05:30
%button.btn.btn-link{ type: 'button' }
2017-08-17 22:00:37 +05:30
%span.dropdown-label-box{ style: 'background: {{color}}' }
%span.label-title.js-data-value
{{title}}
2018-03-17 18:26:18 +05:30
#js-dropdown-my-reaction.filtered-search-input-dropdown-menu.dropdown-menu
2018-12-13 13:39:08 +05:30
%ul{ data: { dropdown: true } }
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'None' } }
2018-12-13 13:39:08 +05:30
%button.btn.btn-link{ type: 'button' }
= _('None')
2019-03-02 22:35:43 +05:30
%li.filter-dropdown-item{ data: { value: 'Any' } }
2018-12-13 13:39:08 +05:30
%button.btn.btn-link{ type: 'button' }
= _('Any')
%li.divider.droplab-item-ignore
2018-03-17 18:26:18 +05:30
%ul.filter-dropdown{ data: { dynamic: true, dropdown: true } }
%li.filter-dropdown-item
2018-12-05 23:21:45 +05:30
%button.btn.btn-link{ type: 'button' }
2018-03-17 18:26:18 +05:30
%gl-emoji
%span.js-data-value.prepend-left-10
{{name}}
2018-12-05 23:21:45 +05:30
#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')
2019-05-18 00:54:41 +05:30
#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')
#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}}
2018-11-08 19:23:39 +05:30
= render_if_exists 'shared/issuable/filter_weight', type: type
2017-09-10 17:25:29 +05:30
%button.clear-search.hidden{ type: 'button' }
= icon('times')
2017-08-17 22:00:37 +05:30
.filter-dropdown-container
- if type == :boards
2018-11-08 19:23:39 +05:30
.js-board-config{ data: { can_admin_list: user_can_admin_list, has_scope: board.scoped? } }
- if user_can_admin_list
= render 'shared/issuable/board_create_list_dropdown', board: board
2018-03-27 19:54:05 +05:30
- if @project
#js-add-issues-btn.prepend-left-10{ data: { can_admin_list: can?(current_user, :admin_list, @project) } }
2018-11-08 19:23:39 +05:30
#js-toggle-focus-btn
2019-02-15 15:39:39 +05:30
- elsif type != :boards_modal
= render 'shared/issuable/sort_dropdown'