2016-06-02 11:05:42 +05:30
|
|
|
- if controller.controller_path =~ /^groups/ && @group.persisted?
|
|
|
|
- label = 'This group'
|
|
|
|
- if controller.controller_path =~ /^projects/ && @project.persisted?
|
|
|
|
- label = 'This project'
|
|
|
|
|
|
|
|
.search.search-form{class: "#{'has-location-badge' if label.present?}"}
|
|
|
|
= form_tag search_path, method: :get, class: 'navbar-form' do |f|
|
|
|
|
.search-input-container
|
2016-06-16 23:09:34 +05:30
|
|
|
- if label.present?
|
|
|
|
.location-badge= label
|
2016-06-02 11:05:42 +05:30
|
|
|
.search-input-wrap
|
|
|
|
.dropdown{ data: {url: search_autocomplete_path } }
|
|
|
|
= search_field_tag "search", nil, placeholder: 'Search', class: "search-input dropdown-menu-toggle", spellcheck: false, tabindex: "1", autocomplete: 'off', data: { toggle: 'dropdown' }
|
|
|
|
.dropdown-menu.dropdown-select
|
|
|
|
= dropdown_content do
|
|
|
|
%ul
|
|
|
|
%li
|
|
|
|
%a.is-focused.dropdown-menu-empty-link
|
|
|
|
Loading...
|
|
|
|
= dropdown_loading
|
|
|
|
%i.search-icon
|
|
|
|
%i.clear-icon.js-clear-input
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
= hidden_field_tag :group_id, @group.try(:id)
|
2016-06-02 11:05:42 +05:30
|
|
|
= hidden_field_tag :project_id, @project && @project.persisted? ? @project.id : '', id: 'search_project_id'
|
2015-04-26 12:48:37 +05:30
|
|
|
|
2016-06-02 11:05:42 +05:30
|
|
|
- if @project && @project.persisted?
|
2015-04-26 12:48:37 +05:30
|
|
|
- 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-11-26 14:37:03 +05:30
|
|
|
- elsif current_controller?(:commits)
|
|
|
|
= hidden_field_tag :scope, 'commits'
|
2015-04-26 12:48:37 +05:30
|
|
|
- else
|
|
|
|
= hidden_field_tag :search_code, true
|
|
|
|
|
2016-06-22 15:30:34 +05:30
|
|
|
:javascript
|
|
|
|
gl.projectOptions = gl.projectOptions || {};
|
|
|
|
gl.projectOptions["#{j(@project.path)}"] = {
|
|
|
|
issuesPath: "#{namespace_project_issues_path(@project.namespace, @project)}",
|
|
|
|
mrPath: "#{namespace_project_merge_requests_path(@project.namespace, @project)}",
|
|
|
|
name: "#{j(@project.name)}"
|
|
|
|
};
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
- if @group && @group.persisted? && @group.path
|
2016-06-22 15:30:34 +05:30
|
|
|
:javascript
|
|
|
|
gl.groupOptions = gl.groupOptions || {};
|
|
|
|
gl.groupOptions["#{j(@group.path)}"] = {
|
|
|
|
name: "#{j(@group.name)}",
|
|
|
|
issuesPath: "#{issues_group_path(j(@group.path))}",
|
|
|
|
mrPath: "#{merge_requests_group_path(j(@group.path))}"
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
:javascript
|
|
|
|
gl.dashboardOptions = {
|
|
|
|
issuesPath: "#{issues_dashboard_url}",
|
|
|
|
mrPath: "#{merge_requests_dashboard_url}"
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-04-26 12:48:37 +05:30
|
|
|
- if @snippet || @snippets
|
|
|
|
= hidden_field_tag :snippets, true
|
2014-09-02 18:07:02 +05:30
|
|
|
= hidden_field_tag :repository_ref, @ref
|
2015-04-26 12:48:37 +05:30
|
|
|
= button_tag 'Go' if ENV['RAILS_ENV'] == 'test'
|
2014-09-02 18:07:02 +05:30
|
|
|
.search-autocomplete-opts.hide{:'data-autocomplete-path' => search_autocomplete_path, :'data-autocomplete-project-id' => @project.try(:id), :'data-autocomplete-project-ref' => @ref }
|