diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-02 22:38:45 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-02 22:38:45 +0200 |
commit | 5f15ed04fc58cfe8b7d54b3490248430575b16d9 (patch) | |
tree | 4ebcb228dffb8ade79ed270eb90f777a46784e8f | |
parent | c2e5343849fdfc24d7f363da7eb881214bf1b327 (diff) | |
download | gitlab-ce-5f15ed04fc58cfe8b7d54b3490248430575b16d9.tar.gz |
Respect current controller scope when using search from project area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r-- | app/views/layouts/_search.html.haml | 11 | ||||
-rw-r--r-- | app/views/search/_project_filter.html.haml | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml index 2460a6a014d..04f79846858 100644 --- a/app/views/layouts/_search.html.haml +++ b/app/views/layouts/_search.html.haml @@ -4,7 +4,16 @@ = hidden_field_tag :group_id, @group.try(:id) - if @project && @project.persisted? = hidden_field_tag :project_id, @project.id - = hidden_field_tag :search_code, true + + - 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 + - if @snippet || @snippets = hidden_field_tag :snippets, true = hidden_field_tag :repository_ref, @ref diff --git a/app/views/search/_project_filter.html.haml b/app/views/search/_project_filter.html.haml index c201b3d6c47..ad933502a28 100644 --- a/app/views/search/_project_filter.html.haml +++ b/app/views/search/_project_filter.html.haml @@ -25,6 +25,7 @@ = @search_results.notes_count %li{class: ("active" if @scope == 'wiki_blobs')} = link_to search_filter_path(scope: 'wiki_blobs') do + %i.fa.fa-book Wiki .pull-right = @search_results.wiki_blobs_count |