debian-mirror-gitlab/app/views/layouts/_search.html.haml

43 lines
2.6 KiB
Text
Raw Normal View History

2019-09-30 21:07:59 +05:30
.search.search-form{ data: { track_label: "navbar_search", track_event: "activate_form_input", track_value: "" } }
2020-10-24 23:57:45 +05:30
= form_tag search_path, method: :get, class: 'form-inline' do |_f|
2016-06-02 11:05:42 +05:30
.search-input-container
.search-input-wrap
2020-07-28 23:09:34 +05:30
.dropdown{ data: { url: search_autocomplete_path } }
2018-11-18 11:00:15 +05:30
= search_field_tag 'search', nil, placeholder: _('Search or jump to…'),
2018-03-17 18:26:18 +05:30
class: 'search-input dropdown-menu-toggle no-outline js-search-dashboard-options',
spellcheck: false,
tabindex: '1',
autocomplete: 'off',
data: { issues_path: issues_dashboard_path,
2019-10-12 21:52:04 +05:30
mr_path: merge_requests_dashboard_path,
qa_selector: 'search_term_field' },
2018-11-18 11:00:15 +05:30
aria: { label: _('Search or jump to…') }
2018-03-17 18:26:18 +05:30
%button.hidden.js-dropdown-search-toggle{ type: 'button', data: { toggle: 'dropdown' } }
2019-09-04 21:01:54 +05:30
.dropdown-menu.dropdown-select.js-dashboard-search-options
2016-06-02 11:05:42 +05:30
= dropdown_content do
%ul
2018-03-17 18:26:18 +05:30
%li.dropdown-menu-empty-item
%a
2018-11-18 11:00:15 +05:30
= _('Loading...')
2016-06-02 11:05:42 +05:30
= dropdown_loading
2020-10-24 23:57:45 +05:30
= sprite_icon('search', css_class: 'search-icon')
= sprite_icon('close', css_class: 'clear-icon js-clear-input')
2016-06-02 11:05:42 +05:30
2020-06-23 00:09:42 +05:30
= 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-11-03 12:29:30 +05:30
2020-06-23 00:09:42 +05:30
- if search_context.for_project?
= hidden_field_tag :scope, search_context.scope
= hidden_field_tag :search_code, search_context.code_search?
2015-04-26 12:48:37 +05:30
2020-06-23 00:09:42 +05:30
= hidden_field_tag :snippets, search_context.for_snippets?
= hidden_field_tag :repository_ref, search_context.ref
2019-10-12 21:52:04 +05:30
= hidden_field_tag :nav_source, 'navbar'
2020-06-23 00:09:42 +05:30
2019-12-04 20:38:33 +05:30
-# workaround for non-JS feature specs, see spec/support/helpers/search_helpers.rb
- if ENV['RAILS_ENV'] == 'test'
%noscript= button_tag 'Search'
2020-07-28 23:09:34 +05:30
.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 }