BigW Consortium Gitlab

Improve search results output. Fixes some markup issues

parent c9054319
.search-results {
.search-result-row {
border-bottom: 1px solid #EEE;
padding-bottom: 10px;
margin-bottom: 10px;
}
}
......@@ -106,6 +106,6 @@ module SearchHelper
# Sanitize html generated after parsing markdown from issue description or comment
def search_md_sanitize(html)
sanitize(html, tags: %w(a p ul li pre code))
sanitize(html, tags: %w(a p ol ul li pre code))
end
end
.row
.col-sm-3
%ul.nav.nav-pills.nav-stacked.search-filter
%ul.nav.nav-pills.nav-stacked.search-filter
%li{class: ("active" if @scope == 'projects')}
= link_to search_filter_path(scope: 'projects') do
Projects
......@@ -16,12 +14,3 @@
Merge requests
.pull-right
= @search_results.merge_requests_count
.col-sm-9
.search_results
- if @search_results.empty?
= render partial: "search/results/empty", locals: { message: "We couldn't find any matching results" }
%ul.bordered-list.top-list
= render partial: "search/results/#{@scope.singularize}", collection: @objects
= paginate @objects, theme: 'gitlab'
.row
.col-sm-3
%ul.nav.nav-pills.nav-stacked.search-filter
%ul.nav.nav-pills.nav-stacked.search-filter
%li{class: ("active" if @scope == 'blobs')}
= link_to search_filter_path(scope: 'blobs') do
%i.icon-code
......@@ -25,12 +23,3 @@
Comments
.pull-right
= @search_results.notes_count
.col-sm-9
.search_results
- if @search_results.empty?
= render partial: "search/results/empty", locals: { message: "We couldn't find any matching results" }
%ul.bordered-list.top-list
= render partial: "search/results/#{@scope.singularize}", collection: @objects
= paginate @objects, theme: 'gitlab'
......@@ -7,10 +7,19 @@
%hr
- if @project
= render "project_results"
- else
= render "global_results"
.row
.col-sm-3
- if @project
= render "project_filter"
- else
= render "global_filter"
.col-sm-9
.search-results
- if @search_results.empty?
= render partial: "search/results/empty", locals: { message: "We couldn't find any matching results" }
- else
= render partial: "search/results/#{@scope.singularize}", collection: @objects
= paginate @objects, theme: 'gitlab'
:javascript
$(".search_results .term").highlight("#{escape_javascript(params[:search])}");
$(".search-results .term").highlight("#{escape_javascript(params[:search])}");
%li
.search-result-row
%h4
= link_to [issue.project, issue] do
%span.term.str-truncated= issue.title
......
%li
.search-result-row
%h4
= link_to [merge_request.target_project, merge_request] do
%span.term.str-truncated= merge_request.title
......
- project = note.project
%li
%h5.note-search-caption
.search-result-row
%h5.note-search-caption.str-truncated
%i.icon-comment
= link_to_member(project, note.author, avatar: false)
commented on
......
%li
.search-result-row
%h4
= link_to project do
%span.term= project.name_with_namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment