Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
7e59a8fe
Commit
7e59a8fe
authored
Aug 27, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve comment search results
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
13f6dc1a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
14 deletions
+35
-14
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+5
-0
app/views/search/_global_results.html.haml
app/views/search/_global_results.html.haml
+1
-1
app/views/search/_project_results.html.haml
app/views/search/_project_results.html.haml
+1
-1
app/views/search/results/_note.html.haml
app/views/search/results/_note.html.haml
+25
-8
app/views/search/results/_project.html.haml
app/views/search/results/_project.html.haml
+3
-4
No files found.
app/helpers/search_helper.rb
View file @
7e59a8fe
...
...
@@ -103,4 +103,9 @@ module SearchHelper
options
=
exist_opts
.
merge
(
options
)
search_path
(
options
)
end
# 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)
)
end
end
app/views/search/_global_results.html.haml
View file @
7e59a8fe
...
...
@@ -22,6 +22,6 @@
-
if
@search_results
.
empty?
=
render
partial:
"search/results/empty"
,
locals:
{
message:
"We couldn't find any matching results"
}
%ul
.bordered-list
%ul
.bordered-list
.top-list
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@objects
=
paginate
@objects
,
theme:
'gitlab'
app/views/search/_project_results.html.haml
View file @
7e59a8fe
...
...
@@ -31,6 +31,6 @@
-
if
@search_results
.
empty?
=
render
partial:
"search/results/empty"
,
locals:
{
message:
"We couldn't find any matching results"
}
%ul
.bordered-list
%ul
.bordered-list
.top-list
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@objects
=
paginate
@objects
,
theme:
'gitlab'
app/views/search/results/_note.html.haml
View file @
7e59a8fe
-
project
=
note
.
project
%li
note on issue:
=
link_to
[
note
.
project
,
note
.
noteable
]
do
%span
##{note.noteable.iid}
%strong
.term
=
truncate
note
.
noteable
.
title
,
length:
50
%span
.light
(
#{
note
.
project
.
name_with_namespace
}
)
-
if
note
.
noteable
.
closed?
%span
.label
Closed
%h5
.note-search-caption
%i
.icon-comment
=
link_to_member
(
project
,
note
.
author
,
avatar:
false
)
commented on
-
if
note
.
for_commit?
=
link_to
project
do
=
project
.
name_with_namespace
·
=
link_to
project_commit_path
(
project
,
note
.
commit_id
,
anchor:
dom_id
(
note
))
do
Commit
#{
note
.
commit_id
[
0
..
8
]
}
-
else
=
link_to
project
do
=
project
.
name_with_namespace
·
%span
#{
note
.
noteable_type
.
titleize
}
##{note.noteable.iid}
·
=
link_to
[
project
,
note
.
noteable
,
anchor:
dom_id
(
note
)]
do
=
note
.
noteable
.
title
.note-search-result
.term
=
preserve
do
=
search_md_sanitize
(
markdown
(
note
.
note
,
{
no_header_anchors:
true
}))
app/views/search/results/_project.html.haml
View file @
7e59a8fe
%li
project:
=
link_to
project
do
%strong
.term
=
project
.
name_with_namespace
%h4
=
link_to
project
do
%span
.term
=
project
.
name_with_namespace
-
if
project
.
description
.
present?
–
%span
.light.term
=
project
.
description
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment