2019-07-16 12:44:15 +00:00
|
|
|
.search.search-form{ data: { track_label: "navbar_search", track_event: "activate_form_input", track_value: "" } }
|
2020-08-20 00:10:11 +00:00
|
|
|
= form_tag search_path, method: :get, class: 'form-inline' do |_f|
|
2016-03-09 00:39:14 +00:00
|
|
|
.search-input-container
|
|
|
|
.search-input-wrap
|
2020-07-10 09:09:01 +00:00
|
|
|
.dropdown{ data: { url: search_autocomplete_path } }
|
2018-08-07 09:59:01 +00:00
|
|
|
= search_field_tag 'search', nil, placeholder: _('Search or jump to…'),
|
2017-12-05 02:18:45 +00: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 08:04:26 +00:00
|
|
|
mr_path: merge_requests_dashboard_path,
|
|
|
|
qa_selector: 'search_term_field' },
|
2018-08-07 09:59:01 +00:00
|
|
|
aria: { label: _('Search or jump to…') }
|
2017-12-06 18:36:51 +00:00
|
|
|
%button.hidden.js-dropdown-search-toggle{ type: 'button', data: { toggle: 'dropdown' } }
|
2020-10-30 09:08:39 +00:00
|
|
|
.dropdown-menu.dropdown-select{ data: { testid: 'dashboard-search-options' } }
|
2016-03-23 19:12:33 +00:00
|
|
|
= dropdown_content do
|
2016-03-25 06:02:22 +00:00
|
|
|
%ul
|
2017-08-29 16:55:47 +00:00
|
|
|
%li.dropdown-menu-empty-item
|
|
|
|
%a
|
2018-06-13 06:30:40 +00:00
|
|
|
= _('Loading...')
|
2016-03-14 21:14:29 +00:00
|
|
|
= dropdown_loading
|
2020-08-10 18:09:54 +00:00
|
|
|
= sprite_icon('search', css_class: 'search-icon')
|
|
|
|
= sprite_icon('close', css_class: 'clear-icon js-clear-input')
|
2014-12-02 20:38:45 +00:00
|
|
|
|
2020-06-02 00:08:07 +00: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 21:49:26 +00:00
|
|
|
|
2020-06-02 00:08:07 +00:00
|
|
|
- if search_context.for_project?
|
|
|
|
= hidden_field_tag :scope, search_context.scope
|
|
|
|
= hidden_field_tag :search_code, search_context.code_search?
|
2016-03-08 07:56:43 +00:00
|
|
|
|
2020-06-02 00:08:07 +00:00
|
|
|
= hidden_field_tag :snippets, search_context.for_snippets?
|
|
|
|
= hidden_field_tag :repository_ref, search_context.ref
|
2019-07-29 09:58:58 +00:00
|
|
|
= hidden_field_tag :nav_source, 'navbar'
|
2020-06-02 00:08:07 +00:00
|
|
|
|
2019-08-30 09:49:14 +00: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 09:09:01 +00: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 }
|