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/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/layouts/_search.html.haml13
-rw-r--r--app/views/search/_result.html.haml30
-rw-r--r--app/views/search/show.html.haml1
3 files changed, 25 insertions, 19 deletions
diff --git a/app/views/layouts/_search.html.haml b/app/views/layouts/_search.html.haml
index 2470314f6fc..b7f89e3fe3a 100644
--- a/app/views/layouts/_search.html.haml
+++ b/app/views/layouts/_search.html.haml
@@ -3,13 +3,6 @@
= text_field_tag "search", nil, placeholder: "Search", class: "search-input"
= hidden_field_tag :group_id, @group.try(:id)
= hidden_field_tag :project_id, @project.try(:id)
- - if @ref
- - @branch_ref = @ref
- - else
- - @branch_ref = @project.try(:default_branch)
- - if @branch_ref.blank?
- - @branch_ref = 'master'
- = hidden_field_tag :branch_ref, @branch_ref
- - if ENV['RAILS_ENV'] == 'test'
- = submit_tag 'Go'
- .search-autocomplete-json.hide{:'data-autocomplete-opts' => search_autocomplete_source } \ No newline at end of file
+ = hidden_field_tag :repository_ref, @ref
+ = submit_tag 'Go' if ENV['RAILS_ENV'] == 'test'
+ .search-autocomplete-json.hide{:'data-autocomplete-opts' => search_autocomplete_source }
diff --git a/app/views/search/_result.html.haml b/app/views/search/_result.html.haml
index 12ead3bf67c..9824ea1dbc8 100644
--- a/app/views/search/_result.html.haml
+++ b/app/views/search/_result.html.haml
@@ -1,9 +1,20 @@
%fieldset
%legend
Search results
- %span.cgray (#{@projects.count + @merge_requests.count + @issues.count + @wiki_pages.count})
+ %span.cgray (#{@projects.count + @merge_requests.count + @issues.count + @wiki_pages.count + @blobs.count})
+
+- if @project
+ %ul.nav.nav-pills
+ %li{class: ("active" if params[:search_code].present?)}
+ = link_to search_path(params.merge(search_code: true)) do
+ Repository Code
+ %li{class: ("active" if params[:search_code].blank?)}
+ = link_to search_path(params.merge(search_code: nil)) do
+ Everything else
+
+
.search_results
- %ul.well-list
+ %ul.bordered-list
- @projects.each do |project|
%li
project:
@@ -32,16 +43,17 @@
%strong.term
= truncate wiki_page.title, length: 50
%span.light (#{wiki_page.project.name_with_namespace})
- - @snippets.each do |snippet|
+ - @blobs.each do |file|
%li
- code:
- = link_to project_blob_path(snippet.project, tree_join(snippet.tree, snippet.filename), :anchor => "L" + snippet.startline.to_s) do
- %strong.term
- = snippet.filename
.file_holder
- .file_content.code
+ .file_title
+ = link_to project_blob_path(@project, tree_join(file.ref, file.filename), :anchor => "L" + file.startline.to_s) do
+ %i.icon-file
+ %strong
+ = file.filename
+ .file_content.code.term
%div{class: user_color_scheme_class}
- = raw snippet.colorize( formatter: :gitlab, options: { first_line_number: snippet.startline } )
+ = raw file.colorize( formatter: :gitlab, options: { first_line_number: file.startline } )
:javascript
$(function() {
diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml
index 5914c22df6e..c057459a746 100644
--- a/app/views/search/show.html.haml
+++ b/app/views/search/show.html.haml
@@ -4,6 +4,7 @@
%span Looking for
.input
= search_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge search-text-input", id: "dashboard_search"
+ = hidden_field_tag :search_code, params[:search_code]
= submit_tag 'Search', class: "btn btn-primary wide"
.clearfix
.row