Respect current controller scope when using search from project area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
c2e5343849
commit
5f15ed04fc
|
@ -4,7 +4,16 @@
|
||||||
= hidden_field_tag :group_id, @group.try(:id)
|
= hidden_field_tag :group_id, @group.try(:id)
|
||||||
- if @project && @project.persisted?
|
- if @project && @project.persisted?
|
||||||
= hidden_field_tag :project_id, @project.id
|
= hidden_field_tag :project_id, @project.id
|
||||||
|
|
||||||
|
- 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'
|
||||||
|
- else
|
||||||
= hidden_field_tag :search_code, true
|
= hidden_field_tag :search_code, true
|
||||||
|
|
||||||
- if @snippet || @snippets
|
- if @snippet || @snippets
|
||||||
= hidden_field_tag :snippets, true
|
= hidden_field_tag :snippets, true
|
||||||
= hidden_field_tag :repository_ref, @ref
|
= hidden_field_tag :repository_ref, @ref
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
= @search_results.notes_count
|
= @search_results.notes_count
|
||||||
%li{class: ("active" if @scope == 'wiki_blobs')}
|
%li{class: ("active" if @scope == 'wiki_blobs')}
|
||||||
= link_to search_filter_path(scope: 'wiki_blobs') do
|
= link_to search_filter_path(scope: 'wiki_blobs') do
|
||||||
|
%i.fa.fa-book
|
||||||
Wiki
|
Wiki
|
||||||
.pull-right
|
.pull-right
|
||||||
= @search_results.wiki_blobs_count
|
= @search_results.wiki_blobs_count
|
||||||
|
|
Loading…
Reference in New Issue