2016-07-26 17:49:26 -04:00
|
|
|
- if @group && @group.persisted? && @group.path
|
2016-08-25 20:17:17 -04:00
|
|
|
- group_data_attrs = { group_path: j(@group.path), name: @group.name, issues_path: issues_group_path(j(@group.path)), mr_path: merge_requests_group_path(j(@group.path)) }
|
2016-07-26 17:49:26 -04:00
|
|
|
- if @project && @project.persisted?
|
2017-10-24 13:49:01 -04:00
|
|
|
- project_data_attrs = { project_path: j(@project.path), name: j(@project.name), issues_path: project_issues_path(@project), mr_path: project_merge_requests_path(@project), issues_disabled: !@project.issues_enabled? }
|
2018-08-07 05:59:01 -04:00
|
|
|
.search.search-form
|
2018-04-10 14:13:25 -04:00
|
|
|
= form_tag search_path, method: :get, class: 'form-inline' do |f|
|
2016-03-08 19:39:14 -05:00
|
|
|
.search-input-container
|
|
|
|
.search-input-wrap
|
2016-07-26 17:49:26 -04:00
|
|
|
.dropdown{ data: { url: search_autocomplete_path } }
|
2018-08-07 05:59:01 -04:00
|
|
|
= search_field_tag 'search', nil, placeholder: _('Search or jump to…'),
|
2017-12-04 21:18:45 -05:00
|
|
|
class: 'search-input dropdown-menu-toggle no-outline js-search-dashboard-options',
|
|
|
|
spellcheck: false,
|
|
|
|
tabindex: '1',
|
|
|
|
autocomplete: 'off',
|
|
|
|
data: { issues_path: issues_dashboard_path,
|
|
|
|
mr_path: merge_requests_dashboard_path },
|
2018-08-07 05:59:01 -04:00
|
|
|
aria: { label: _('Search or jump to…') }
|
2017-12-06 13:36:51 -05:00
|
|
|
%button.hidden.js-dropdown-search-toggle{ type: 'button', data: { toggle: 'dropdown' } }
|
2016-03-14 17:14:29 -04:00
|
|
|
.dropdown-menu.dropdown-select
|
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
|
2017-09-28 09:43:52 -04:00
|
|
|
= sprite_icon('search', size: 16, css_class: 'search-icon')
|
|
|
|
= sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input')
|
2014-12-02 15:38:45 -05:00
|
|
|
|
2016-07-26 17:49:26 -04:00
|
|
|
= hidden_field_tag :group_id, @group.try(:id), class: 'js-search-group-options', data: group_data_attrs
|
|
|
|
|
|
|
|
= hidden_field_tag :project_id, @project && @project.persisted? ? @project.id : '', id: 'search_project_id', class: 'js-search-project-options', data: project_data_attrs
|
2016-03-08 02:56:43 -05:00
|
|
|
|
|
|
|
- if @project && @project.persisted?
|
2014-12-02 15:38:45 -05:00
|
|
|
- if current_controller?(:issues)
|
|
|
|
= hidden_field_tag :scope, 'issues'
|
|
|
|
- elsif current_controller?(:merge_requests)
|
|
|
|
= hidden_field_tag :scope, 'merge_requests'
|
|
|
|
- elsif current_controller?(:wikis)
|
|
|
|
= hidden_field_tag :scope, 'wiki_blobs'
|
2015-06-14 18:04:20 -04:00
|
|
|
- elsif current_controller?(:commits)
|
|
|
|
= hidden_field_tag :scope, 'commits'
|
2014-12-02 15:38:45 -05:00
|
|
|
- else
|
|
|
|
= hidden_field_tag :search_code, true
|
|
|
|
|
2014-08-29 15:22:45 -04:00
|
|
|
- if @snippet || @snippets
|
|
|
|
= hidden_field_tag :snippets, true
|
2013-05-09 04:27:14 -04:00
|
|
|
= hidden_field_tag :repository_ref, @ref
|
2014-09-26 10:57:36 -04:00
|
|
|
= button_tag 'Go' if ENV['RAILS_ENV'] == 'test'
|
2018-04-24 17:40:46 -04:00
|
|
|
.search-autocomplete-opts.hide{ :'data-autocomplete-path' => search_autocomplete_path, :'data-autocomplete-project-id' => @project.try(:id), :'data-autocomplete-project-ref' => @ref }
|