diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-02 23:38:45 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-02 23:38:45 +0300 |
commit | 5f15ed04fc58cfe8b7d54b3490248430575b16d9 (patch) | |
tree | 4ebcb228dffb8ade79ed270eb90f777a46784e8f /app/views/layouts/_search.html.haml | |
parent | c2e5343849fdfc24d7f363da7eb881214bf1b327 (diff) |
Respect current controller scope when using search from project area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/views/layouts/_search.html.haml')
-rw-r--r-- | app/views/layouts/_search.html.haml | 11 |
1 files changed, 10 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 |