diff options
author | Ralf Seidler <ralf.seidler@uni-jena.de> | 2014-09-05 12:33:05 +0200 |
---|---|---|
committer | Ralf Seidler <ralf.seidler@uni-jena.de> | 2014-09-05 13:36:43 +0200 |
commit | d93b046c4c7adf5a8fe37122864d7b1fabbd5bf6 (patch) | |
tree | e8e9be84ff67cd2b1465d990c58156988c69adfe /app | |
parent | 3a971ca9ef612f44950182ded49c3bf9907fa530 (diff) | |
download | gitlab-ce-d93b046c4c7adf5a8fe37122864d7b1fabbd5bf6.tar.gz |
Added search wiki feature
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/search_controller.rb | 2 | ||||
-rw-r--r-- | app/views/search/_project_filter.html.haml | 6 | ||||
-rw-r--r-- | app/views/search/results/_wiki_blob.html.haml | 9 |
3 files changed, 16 insertions, 1 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index a58b24de643..121307ae1f7 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -9,7 +9,7 @@ class SearchController < ApplicationController @search_results = if @project return access_denied! unless can?(current_user, :download_code, @project) - unless %w(blobs notes issues merge_requests).include?(@scope) + unless %w(blobs notes issues merge_requests wiki_blobs).include?(@scope) @scope = 'blobs' end diff --git a/app/views/search/_project_filter.html.haml b/app/views/search/_project_filter.html.haml index 36947675d18..57a45c9acb6 100644 --- a/app/views/search/_project_filter.html.haml +++ b/app/views/search/_project_filter.html.haml @@ -23,3 +23,9 @@ Comments .pull-right = @search_results.notes_count + %li{class: ("active" if @scope == 'wiki_blobs')} + = link_to search_filter_path(scope: 'wiki_blobs') do + Wiki + .pull-right + = @search_results.wiki_blobs_count + diff --git a/app/views/search/results/_wiki_blob.html.haml b/app/views/search/results/_wiki_blob.html.haml new file mode 100644 index 00000000000..75414d73b0c --- /dev/null +++ b/app/views/search/results/_wiki_blob.html.haml @@ -0,0 +1,9 @@ +.blob-result + .file-holder + .file-title + = link_to project_wiki_path(@project, wiki_blob.filename) do + %i.icon-file + %strong + = wiki_blob.filename + .file-content.code.term + = render 'shared/file_hljs', blob: wiki_blob, first_line_number: wiki_blob.startline |