Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
7e59a8fe
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
7e59a8fe
编写于
8月 27, 2014
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve comment search results
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
13f6dc1a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
35 addition
and
14 deletion
+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
未找到文件。
app/helpers/search_helper.rb
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录