Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
eb7a9868
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,发现更多精彩内容 >>
提交
eb7a9868
编写于
3月 26, 2014
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'improve_at_mentions' into 'master'
Allow at mentions for people who are not members of the project
上级
f0adf28e
9dd58c32
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
44 addition
and
5 deletion
+44
-5
CHANGELOG
CHANGELOG
+9
-0
VERSION
VERSION
+1
-1
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+31
-1
app/views/layouts/_init_auto_complete.html.haml
app/views/layouts/_init_auto_complete.html.haml
+1
-1
lib/gitlab/markdown.rb
lib/gitlab/markdown.rb
+2
-2
未找到文件。
CHANGELOG
浏览文件 @
eb7a9868
v 6.8.0
- Ability to at mention users that are participating in issue and merge req. discussion
v 6.7.2
- Fix upgrader script
v 6.7.1
- Fix GitLab CI integration
v 6.7.0
- Increased the example Nginx client_max_body_size from 5MB to 20MB, consider updating it manually on existing installations
- Add support for Gemnasium as a Project Service (Olivier Gonzalez)
...
...
VERSION
浏览文件 @
eb7a9868
6.7.
0
6.7.
2
app/controllers/projects_controller.rb
浏览文件 @
eb7a9868
...
...
@@ -123,11 +123,20 @@ class ProjectsController < ApplicationController
end
def
autocomplete_sources
note_type
=
params
[
'type'
]
note_id
=
params
[
'type_id'
]
participating
=
if
note_type
&&
note_id
participants_in
(
note_type
,
note_id
)
else
[]
end
team_members
=
sorted
(
@project
.
team
.
members
)
participants
=
team_members
+
participating
@suggestions
=
{
emojis:
Emoji
.
names
.
map
{
|
e
|
{
name:
e
,
path:
view_context
.
image_url
(
"emoji/
#{
e
}
.png"
)
}
},
issues:
@project
.
issues
.
select
([
:iid
,
:title
,
:description
]),
mergerequests:
@project
.
merge_requests
.
select
([
:iid
,
:title
,
:description
]),
members:
@project
.
team
.
members
.
sort_by
(
&
:username
).
map
{
|
user
|
{
username:
user
.
username
,
name:
user
.
name
}
}
members:
participants
.
uniq
}
respond_to
do
|
format
|
...
...
@@ -162,4 +171,25 @@ class ProjectsController < ApplicationController
def
user_layout
current_user
?
"projects"
:
"public_projects"
end
def
participants_in
(
type
,
id
)
users
=
case
type
when
"Issue"
issue
=
@project
.
issues
.
find_by_iid
(
id
)
issue
?
issue
.
participants
:
[]
when
"MergeRequest"
merge_request
=
@project
.
merge_requests
.
find_by_iid
(
id
)
merge_request
?
merge_request
.
participants
:
[]
when
"Commit"
author_ids
=
Note
.
for_commit_id
(
id
).
pluck
(
:author_id
).
uniq
User
.
where
(
id:
author_ids
)
else
[]
end
sorted
(
users
)
end
def
sorted
(
users
)
users
.
uniq
.
sort_by
(
&
:username
).
map
{
|
user
|
{
username:
user
.
username
,
name:
user
.
name
}
}
end
end
app/views/layouts/_init_auto_complete.html.haml
浏览文件 @
eb7a9868
:javascript
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_project_path
(
@project
)
}
"
GitLab
.
GfmAutoComplete
.
dataSource
=
"
#{
autocomplete_sources_project_path
(
@project
,
type:
@noteable
.
class
,
type_id:
params
[
:id
]
)
}
"
GitLab
.
GfmAutoComplete
.
setup
();
lib/gitlab/markdown.rb
浏览文件 @
eb7a9868
...
...
@@ -166,8 +166,8 @@ module Gitlab
end
def
reference_user
(
identifier
)
if
member
=
@project
.
team_members
.
find
{
|
user
|
user
.
username
==
identifier
}
link_to
(
"@
#{
identifier
}
"
,
user_url
(
identifier
),
html_options
.
merge
(
class:
"gfm gfm-team_member
#{
html_options
[
:class
]
}
"
))
if
member
if
user
=
User
.
find_by_username
(
identifier
)
link_to
(
"@
#{
identifier
}
"
,
user_url
(
identifier
),
html_options
.
merge
(
class:
"gfm gfm-team_member
#{
html_options
[
:class
]
}
"
))
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录