summaryrefslogtreecommitdiff
path: root/app/views/search
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/search')
-rw-r--r--app/views/search/_category.html.haml16
-rw-r--r--app/views/search/_filter.html.haml6
-rw-r--r--app/views/search/_form.html.haml12
-rw-r--r--app/views/search/_results.html.haml9
-rw-r--r--app/views/search/results/_blob.html.haml2
-rw-r--r--app/views/search/results/_milestone.html.haml9
-rw-r--r--app/views/search/results/_project.html.haml6
-rw-r--r--app/views/search/results/_snippet_blob.html.haml2
-rw-r--r--app/views/search/results/_wiki_blob.html.haml2
-rw-r--r--app/views/search/show.html.haml2
10 files changed, 42 insertions, 24 deletions
diff --git a/app/views/search/_category.html.haml b/app/views/search/_category.html.haml
index 154332cb9a9..d637abfa76b 100644
--- a/app/views/search/_category.html.haml
+++ b/app/views/search/_category.html.haml
@@ -1,4 +1,4 @@
-%ul.nav.nav-pills.search-filter
+%ul.nav.nav-tabs.search-filter
- if @project
%li{class: ("active" if @scope == 'blobs')}
= link_to search_filter_path(scope: 'blobs') do
@@ -21,6 +21,13 @@
Merge requests
%span.badge
= @search_results.merge_requests_count
+ %li{class: ("active" if @scope == 'milestones')}
+ = link_to search_filter_path(scope: 'milestones') do
+ = icon('clock-o fw')
+ %span
+ Milestones
+ %span.badge
+ = @search_results.milestones_count
%li{class: ("active" if @scope == 'notes')}
= link_to search_filter_path(scope: 'notes') do
= icon('comments fw')
@@ -74,4 +81,11 @@
Merge requests
%span.badge
= @search_results.merge_requests_count
+ %li{class: ("active" if @scope == 'milestones')}
+ = link_to search_filter_path(scope: 'milestones') do
+ = icon('clock-o fw')
+ %span
+ Milestones
+ %span.badge
+ = @search_results.milestones_count
diff --git a/app/views/search/_filter.html.haml b/app/views/search/_filter.html.haml
index e2d0cab9e79..ec478a5963d 100644
--- a/app/views/search/_filter.html.haml
+++ b/app/views/search/_filter.html.haml
@@ -1,6 +1,5 @@
.dropdown.inline
- %button.dropdown-toggle.btn.btn{type: 'button', 'data-toggle' => 'dropdown'}
- %i.fa.fa-tags
+ %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'}
%span.light Group:
- if @group.present?
%strong= @group.name
@@ -17,8 +16,7 @@
= group.name
.dropdown.inline.prepend-left-10.project-filter
- %button.dropdown-toggle.btn.btn{type: 'button', 'data-toggle' => 'dropdown'}
- %i.fa.fa-tags
+ %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'}
%span.light Project:
- if @project.present?
%strong= @project.name_with_namespace
diff --git a/app/views/search/_form.html.haml b/app/views/search/_form.html.haml
index 5ee70be1ad6..3938c545cad 100644
--- a/app/views/search/_form.html.haml
+++ b/app/views/search/_form.html.haml
@@ -1,12 +1,14 @@
-= form_tag search_path, method: :get, class: 'form-inline' do |f|
+= form_tag search_path, method: :get do |f|
= hidden_field_tag :project_id, params[:project_id]
= hidden_field_tag :group_id, params[:group_id]
= hidden_field_tag :snippets, params[:snippets]
= hidden_field_tag :scope, params[:scope]
+
.search-holder.clearfix
- .form-group
+ .input-group
= search_field_tag :search, params[:search], placeholder: "Search for projects, issues etc", class: "form-control search-text-input", id: "dashboard_search", autofocus: true
- = button_tag 'Search', class: "btn btn-primary"
+ %span.input-group-btn
+ = button_tag 'Search', class: "btn btn-primary"
- unless params[:snippets].eql? 'true'
- .pull-right
- = render 'filter'
+ %br
+ = render 'filter'
diff --git a/app/views/search/_results.html.haml b/app/views/search/_results.html.haml
index 741c780ad96..2a38c98dcfc 100644
--- a/app/views/search/_results.html.haml
+++ b/app/views/search/_results.html.haml
@@ -1,7 +1,7 @@
- if @search_results.empty?
= render partial: "search/results/empty"
- else
- .light
+ %p.light
Search results for
%code
= @search_term
@@ -11,10 +11,13 @@
- elsif @group
in group #{link_to @group.name, @group}
- %br
.results.prepend-top-10
.search-results
- = render partial: "search/results/#{@scope.singularize}", collection: @objects
+ - if @scope == 'projects'
+ .term
+ = render 'shared/projects/list', projects: @objects
+ - else
+ = render partial: "search/results/#{@scope.singularize}", collection: @objects
= paginate @objects, theme: 'gitlab'
:javascript
diff --git a/app/views/search/results/_blob.html.haml b/app/views/search/results/_blob.html.haml
index 58f58eff54d..0fe8a3b490a 100644
--- a/app/views/search/results/_blob.html.haml
+++ b/app/views/search/results/_blob.html.haml
@@ -7,4 +7,4 @@
%strong
= blob.filename
.file-content.code.term
- = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline, user_color_scheme_class: 'white'
+ = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline
diff --git a/app/views/search/results/_milestone.html.haml b/app/views/search/results/_milestone.html.haml
new file mode 100644
index 00000000000..e0b18733d74
--- /dev/null
+++ b/app/views/search/results/_milestone.html.haml
@@ -0,0 +1,9 @@
+.search-result-row
+ %h4
+ = link_to [milestone.project.namespace.becomes(Namespace), milestone.project, milestone] do
+ %span.term.str-truncated= milestone.title
+
+ - if milestone.description.present?
+ .description.term
+ = preserve do
+ = search_md_sanitize(markdown(milestone.description)) \ No newline at end of file
diff --git a/app/views/search/results/_project.html.haml b/app/views/search/results/_project.html.haml
deleted file mode 100644
index 195cf06c8ea..00000000000
--- a/app/views/search/results/_project.html.haml
+++ /dev/null
@@ -1,6 +0,0 @@
-.search-result-row
- %h4
- = link_to [project.namespace.becomes(Namespace), project] do
- %span.term= project.name_with_namespace
- - if project.description.present?
- %span.light.term= project.description
diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml
index 95099853918..9a4f9fb9485 100644
--- a/app/views/search/results/_snippet_blob.html.haml
+++ b/app/views/search/results/_snippet_blob.html.haml
@@ -23,7 +23,7 @@
.nothing-here-block Empty file
- else
.file-content.code
- %div.highlighted-data{class: user_color_scheme_class}
+ %div.highlighted-data{ class: user_color_scheme }
.line-numbers
- snippet_blob[:snippet_chunks].each do |snippet|
- unless snippet[:data].empty?
diff --git a/app/views/search/results/_wiki_blob.html.haml b/app/views/search/results/_wiki_blob.html.haml
index c03438eb952..f5859481d46 100644
--- a/app/views/search/results/_wiki_blob.html.haml
+++ b/app/views/search/results/_wiki_blob.html.haml
@@ -7,4 +7,4 @@
%strong
= wiki_blob.filename
.file-content.code.term
- = render 'shared/file_highlight', blob: wiki_blob, first_line_number: wiki_blob.startline, user_color_scheme_class: 'white'
+ = render 'shared/file_highlight', blob: wiki_blob, first_line_number: wiki_blob.startline
diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml
index 60f9e9ac9de..f4f3dcfc29f 100644
--- a/app/views/search/show.html.haml
+++ b/app/views/search/show.html.haml
@@ -1,7 +1,5 @@
- page_title @search_term
= render 'search/form'
-%hr
- if @search_term
= render 'search/category'
- %hr
= render 'search/results'