2021-09-15 14:11:29 -04:00
|
|
|
.search.search-form{ data: { track_label: "navbar_search", track_action: "activate_form_input", track_value: "" } }
|
2021-05-21 05:10:16 -04:00
|
|
|
= form_tag search_path, method: :get, class: 'form-inline form-control' do |_f|
|
2016-03-08 19:39:14 -05:00
|
|
|
.search-input-container
|
|
|
|
.search-input-wrap
|
2020-07-10 05:09:01 -04:00
|
|
|
.dropdown{ data: { url: search_autocomplete_path } }
|
2021-06-23 05:07:48 -04:00
|
|
|
= search_field_tag 'search', nil, placeholder: _('Search GitLab'),
|
2017-12-04 21:18:45 -05:00
|
|
|
class: 'search-input dropdown-menu-toggle no-outline js-search-dashboard-options',
|
|
|
|
spellcheck: false,
|
|
|
|
autocomplete: 'off',
|
|
|
|
data: { issues_path: issues_dashboard_path,
|
2019-07-30 04:04:26 -04:00
|
|
|
mr_path: merge_requests_dashboard_path,
|
|
|
|
qa_selector: 'search_term_field' },
|
2021-06-23 05:07:48 -04:00
|
|
|
aria: { label: _('Search GitLab') }
|
2017-12-06 13:36:51 -05:00
|
|
|
%button.hidden.js-dropdown-search-toggle{ type: 'button', data: { toggle: 'dropdown' } }
|
2020-10-30 05:08:39 -04:00
|
|
|
.dropdown-menu.dropdown-select{ data: { testid: 'dashboard-search-options' } }
|
2016-03-23 15:12:33 -04:00
|
|
|
= dropdown_content do
|
2016-03-25 02:02:22 -04:00
|
|
|
%ul
|
2017-08-29 12:55:47 -04:00
|
|
|
%li.dropdown-menu-empty-item
|
|
|
|
%a
|
2018-06-13 02:30:40 -04:00
|
|
|
= _('Loading...')
|
2016-03-14 17:14:29 -04:00
|
|
|
= dropdown_loading
|
2020-08-10 14:09:54 -04:00
|
|
|
= sprite_icon('search', css_class: 'search-icon')
|
|
|
|
= sprite_icon('close', css_class: 'clear-icon js-clear-input')
|
2014-12-02 15:38:45 -05:00
|
|
|
|
2020-06-01 20:08:07 -04:00
|
|
|
= hidden_field_tag :group_id, search_context.for_group? ? search_context.group.id : '', class: 'js-search-group-options', data: search_context.group_metadata
|
|
|
|
= hidden_field_tag :project_id, search_context.for_project? ? search_context.project.id : '', id: 'search_project_id', class: 'js-search-project-options', data: search_context.project_metadata
|
2016-07-26 17:49:26 -04:00
|
|
|
|
2021-03-23 11:09:28 -04:00
|
|
|
- if search_context.for_project? || search_context.for_group?
|
2020-06-01 20:08:07 -04:00
|
|
|
= hidden_field_tag :scope, search_context.scope
|
|
|
|
= hidden_field_tag :search_code, search_context.code_search?
|
2016-03-08 02:56:43 -05:00
|
|
|
|
2020-06-01 20:08:07 -04:00
|
|
|
= hidden_field_tag :snippets, search_context.for_snippets?
|
|
|
|
= hidden_field_tag :repository_ref, search_context.ref
|
2019-07-29 05:58:58 -04:00
|
|
|
= hidden_field_tag :nav_source, 'navbar'
|
2020-06-01 20:08:07 -04:00
|
|
|
|
2019-08-30 05:49:14 -04:00
|
|
|
-# workaround for non-JS feature specs, see spec/support/helpers/search_helpers.rb
|
|
|
|
- if ENV['RAILS_ENV'] == 'test'
|
|
|
|
%noscript= button_tag 'Search'
|
2020-07-10 05:09:01 -04:00
|
|
|
.search-autocomplete-opts.hide{ :'data-autocomplete-path' => search_autocomplete_path,
|
|
|
|
:'data-autocomplete-project-id' => search_context.project.try(:id),
|
|
|
|
:'data-autocomplete-project-ref' => search_context.ref }
|