Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-09 17:50:43 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-09 17:50:43 +0400
commit0e78d00bcb8fd0214fb6c592c7b2814f7a70cd42 (patch)
tree0ea5b75d650fc92b82c9da193c5ce8d9e2d98ddd /app
parent04cf074552a047c1b50c54d38a1fd18c7b64c784 (diff)
parent9edf6d4dd08d3bd74df22645a919dbf26d22faf7 (diff)
Merge pull request #7695 from coverer/search_wiki
Added search wiki feature
Diffstat (limited to 'app')
-rw-r--r--app/controllers/search_controller.rb3
-rw-r--r--app/views/search/_project_filter.html.haml6
-rw-r--r--app/views/search/results/_wiki_blob.html.haml9
3 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb
index 58ec8e75d7a..55926a1ed22 100644
--- a/app/controllers/search_controller.rb
+++ b/app/controllers/search_controller.rb
@@ -10,7 +10,8 @@ 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