Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
ea3680ad
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,发现更多精彩内容 >>
提交
ea3680ad
编写于
11月 08, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5571 from bke-drewb/email
Fix minor errors/annoyances in email templates
上级
b287462b
57ad81a9
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
29 addition
and
29 deletion
+29
-29
app/mailers/emails/groups.rb
app/mailers/emails/groups.rb
+1
-1
app/mailers/emails/issues.rb
app/mailers/emails/issues.rb
+3
-3
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+4
-4
app/mailers/emails/notes.rb
app/mailers/emails/notes.rb
+4
-4
app/mailers/emails/projects.rb
app/mailers/emails/projects.rb
+2
-2
app/views/notify/new_merge_request_email.html.haml
app/views/notify/new_merge_request_email.html.haml
+1
-1
app/views/notify/new_merge_request_email.text.erb
app/views/notify/new_merge_request_email.text.erb
+1
-1
app/views/notify/reassigned_merge_request_email.html.haml
app/views/notify/reassigned_merge_request_email.html.haml
+1
-1
app/views/notify/reassigned_merge_request_email.text.erb
app/views/notify/reassigned_merge_request_email.text.erb
+1
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+11
-11
未找到文件。
app/mailers/emails/groups.rb
浏览文件 @
ea3680ad
...
@@ -5,7 +5,7 @@ module Emails
...
@@ -5,7 +5,7 @@ module Emails
@group
=
@membership
.
group
@group
=
@membership
.
group
mail
(
to:
@membership
.
user
.
email
,
mail
(
to:
@membership
.
user
.
email
,
subject:
subject
(
"
a
ccess to group was granted"
))
subject:
subject
(
"
A
ccess to group was granted"
))
end
end
end
end
end
end
app/mailers/emails/issues.rb
浏览文件 @
ea3680ad
...
@@ -3,14 +3,14 @@ module Emails
...
@@ -3,14 +3,14 @@ module Emails
def
new_issue_email
(
recipient_id
,
issue_id
)
def
new_issue_email
(
recipient_id
,
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@project
=
@issue
.
project
@project
=
@issue
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ew issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ew issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
end
end
def
reassigned_issue_email
(
recipient_id
,
issue_id
,
previous_assignee_id
)
def
reassigned_issue_email
(
recipient_id
,
issue_id
,
previous_assignee_id
)
@issue
=
Issue
.
find
(
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@previous_assignee
=
User
.
find_by_id
(
previous_assignee_id
)
if
previous_assignee_id
@previous_assignee
=
User
.
find_by_id
(
previous_assignee_id
)
if
previous_assignee_id
@project
=
@issue
.
project
@project
=
@issue
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
c
hanged issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
C
hanged issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
end
end
def
closed_issue_email
(
recipient_id
,
issue_id
,
updated_by_user_id
)
def
closed_issue_email
(
recipient_id
,
issue_id
,
updated_by_user_id
)
...
@@ -27,7 +27,7 @@ module Emails
...
@@ -27,7 +27,7 @@ module Emails
@project
=
@issue
.
project
@project
=
@issue
.
project
@updated_by
=
User
.
find
updated_by_user_id
@updated_by
=
User
.
find
updated_by_user_id
mail
(
to:
recipient
(
recipient_id
),
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
c
hanged issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
subject:
subject
(
"
C
hanged issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
end
end
end
end
end
end
app/mailers/emails/merge_requests.rb
浏览文件 @
ea3680ad
...
@@ -2,24 +2,24 @@ module Emails
...
@@ -2,24 +2,24 @@ module Emails
module
MergeRequests
module
MergeRequests
def
new_merge_request_email
(
recipient_id
,
merge_request_id
)
def
new_merge_request_email
(
recipient_id
,
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
new merge request !
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
New merge request #
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
end
end
def
reassigned_merge_request_email
(
recipient_id
,
merge_request_id
,
previous_assignee_id
)
def
reassigned_merge_request_email
(
recipient_id
,
merge_request_id
,
previous_assignee_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@previous_assignee
=
User
.
find_by_id
(
previous_assignee_id
)
if
previous_assignee_id
@previous_assignee
=
User
.
find_by_id
(
previous_assignee_id
)
if
previous_assignee_id
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
changed merge request !
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
Changed merge request #
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
end
end
def
closed_merge_request_email
(
recipient_id
,
merge_request_id
,
updated_by_user_id
)
def
closed_merge_request_email
(
recipient_id
,
merge_request_id
,
updated_by_user_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@updated_by
=
User
.
find
updated_by_user_id
@updated_by
=
User
.
find
updated_by_user_id
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Closed merge request
!
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Closed merge request
#
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
end
end
def
merged_merge_request_email
(
recipient_id
,
merge_request_id
)
def
merged_merge_request_email
(
recipient_id
,
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Accepted merge request
!
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Accepted merge request
#
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
end
end
end
end
...
...
app/mailers/emails/notes.rb
浏览文件 @
ea3680ad
...
@@ -4,27 +4,27 @@ module Emails
...
@@ -4,27 +4,27 @@ module Emails
@note
=
Note
.
find
(
note_id
)
@note
=
Note
.
find
(
note_id
)
@commit
=
@note
.
noteable
@commit
=
@note
.
noteable
@project
=
@note
.
project
@project
=
@note
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ote for commit
#{
@commit
.
short_id
}
"
,
@commit
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ote for commit
#{
@commit
.
short_id
}
"
,
@commit
.
title
))
end
end
def
note_issue_email
(
recipient_id
,
note_id
)
def
note_issue_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@note
=
Note
.
find
(
note_id
)
@issue
=
@note
.
noteable
@issue
=
@note
.
noteable
@project
=
@note
.
project
@project
=
@note
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ote for issue #
#{
@issue
.
iid
}
"
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ote for issue #
#{
@issue
.
iid
}
"
))
end
end
def
note_merge_request_email
(
recipient_id
,
note_id
)
def
note_merge_request_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@note
=
Note
.
find
(
note_id
)
@merge_request
=
@note
.
noteable
@merge_request
=
@note
.
noteable
@project
=
@note
.
project
@project
=
@note
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ote for merge request #
#{
@merge_request
.
iid
}
"
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ote for merge request #
#{
@merge_request
.
iid
}
"
))
end
end
def
note_wall_email
(
recipient_id
,
note_id
)
def
note_wall_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@note
=
Note
.
find
(
note_id
)
@project
=
@note
.
project
@project
=
@note
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ote on wall"
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ote on wall"
))
end
end
end
end
end
end
app/mailers/emails/projects.rb
浏览文件 @
ea3680ad
...
@@ -4,14 +4,14 @@ module Emails
...
@@ -4,14 +4,14 @@ module Emails
@users_project
=
UsersProject
.
find
user_project_id
@users_project
=
UsersProject
.
find
user_project_id
@project
=
@users_project
.
project
@project
=
@users_project
.
project
mail
(
to:
@users_project
.
user
.
email
,
mail
(
to:
@users_project
.
user
.
email
,
subject:
subject
(
"
a
ccess to project was granted"
))
subject:
subject
(
"
A
ccess to project was granted"
))
end
end
def
project_was_moved_email
(
project_id
,
user_id
)
def
project_was_moved_email
(
project_id
,
user_id
)
@user
=
User
.
find
user_id
@user
=
User
.
find
user_id
@project
=
Project
.
find
project_id
@project
=
Project
.
find
project_id
mail
(
to:
@user
.
email
,
mail
(
to:
@user
.
email
,
subject:
subject
(
"
p
roject was moved"
))
subject:
subject
(
"
P
roject was moved"
))
end
end
end
end
end
end
app/views/notify/new_merge_request_email.html.haml
浏览文件 @
ea3680ad
%p
%p
=
"New Merge Request
!
#{
@merge_request
.
iid
}
"
=
"New Merge Request
#
#{
@merge_request
.
iid
}
"
%p
%p
=
link_to_gfm
truncate
(
@merge_request
.
title
,
length:
40
),
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
=
link_to_gfm
truncate
(
@merge_request
.
title
,
length:
40
),
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
%p
%p
...
...
app/views/notify/new_merge_request_email.text.erb
浏览文件 @
ea3680ad
New Merge Request
<%=
@merge_request
.
iid
%>
New Merge Request
#
<%=
@merge_request
.
iid
%>
<%=
url_for
(
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
))
%>
<%=
url_for
(
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
))
%>
...
...
app/views/notify/reassigned_merge_request_email.html.haml
浏览文件 @
ea3680ad
%p
%p
=
"Reassigned Merge Request
!
#{
@merge_request
.
iid
}
"
=
"Reassigned Merge Request
#
#{
@merge_request
.
iid
}
"
=
link_to_gfm
truncate
(
@merge_request
.
title
,
length:
30
),
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
=
link_to_gfm
truncate
(
@merge_request
.
title
,
length:
30
),
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
%p
%p
Assignee changed
Assignee changed
...
...
app/views/notify/reassigned_merge_request_email.text.erb
浏览文件 @
ea3680ad
Reassigned Merge Request
<%=
@merge_request
.
iid
%>
Reassigned Merge Request
#
<%=
@merge_request
.
iid
%>
<%=
url_for
(
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
))
%>
<%=
url_for
(
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
))
%>
...
...
spec/mailers/notify_spec.rb
浏览文件 @
ea3680ad
...
@@ -110,7 +110,7 @@ describe Notify do
...
@@ -110,7 +110,7 @@ describe Notify do
it_behaves_like
'an assignee email'
it_behaves_like
'an assignee email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
#{
project
.
name
}
\|
n
ew issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/
should
have_subject
/
#{
project
.
name
}
\|
N
ew issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/
end
end
it
'contains a link to the new issue'
do
it
'contains a link to the new issue'
do
...
@@ -126,7 +126,7 @@ describe Notify do
...
@@ -126,7 +126,7 @@ describe Notify do
it_behaves_like
'a multiple recipients email'
it_behaves_like
'a multiple recipients email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
c
hanged issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/
should
have_subject
/
C
hanged issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/
end
end
it
'contains the name of the previous assignee'
do
it
'contains the name of the previous assignee'
do
...
@@ -148,7 +148,7 @@ describe Notify do
...
@@ -148,7 +148,7 @@ describe Notify do
subject
{
Notify
.
issue_status_changed_email
(
recipient
.
id
,
issue
.
id
,
status
,
current_user
)
}
subject
{
Notify
.
issue_status_changed_email
(
recipient
.
id
,
issue
.
id
,
status
,
current_user
)
}
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
c
hanged issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/i
should
have_subject
/
C
hanged issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/i
end
end
it
'contains the new status'
do
it
'contains the new status'
do
...
@@ -175,7 +175,7 @@ describe Notify do
...
@@ -175,7 +175,7 @@ describe Notify do
it_behaves_like
'an assignee email'
it_behaves_like
'an assignee email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
new merge request !
#{
merge_request
.
iid
}
/
should
have_subject
/
New merge request #
#{
merge_request
.
iid
}
/
end
end
it
'contains a link to the new merge request'
do
it
'contains a link to the new merge request'
do
...
@@ -199,7 +199,7 @@ describe Notify do
...
@@ -199,7 +199,7 @@ describe Notify do
it_behaves_like
'a multiple recipients email'
it_behaves_like
'a multiple recipients email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
changed merge request !
#{
merge_request
.
iid
}
/
should
have_subject
/
Changed merge request #
#{
merge_request
.
iid
}
/
end
end
it
'contains the name of the previous assignee'
do
it
'contains the name of the previous assignee'
do
...
@@ -224,7 +224,7 @@ describe Notify do
...
@@ -224,7 +224,7 @@ describe Notify do
subject
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
)
}
subject
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
)
}
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
p
roject was moved/
should
have_subject
/
P
roject was moved/
end
end
it
'contains name of project'
do
it
'contains name of project'
do
...
@@ -244,7 +244,7 @@ describe Notify do
...
@@ -244,7 +244,7 @@ describe Notify do
user:
user
)
}
user:
user
)
}
subject
{
Notify
.
project_access_granted_email
(
users_project
.
id
)
}
subject
{
Notify
.
project_access_granted_email
(
users_project
.
id
)
}
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
a
ccess to project was granted/
should
have_subject
/
A
ccess to project was granted/
end
end
it
'contains name of project'
do
it
'contains name of project'
do
should
have_body_text
/
#{
project
.
name
}
/
should
have_body_text
/
#{
project
.
name
}
/
...
@@ -302,7 +302,7 @@ describe Notify do
...
@@ -302,7 +302,7 @@ describe Notify do
it_behaves_like
'a note email'
it_behaves_like
'a note email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
n
ote for commit
#{
commit
.
short_id
}
/
should
have_subject
/
N
ote for commit
#{
commit
.
short_id
}
/
end
end
it
'contains a link to the commit'
do
it
'contains a link to the commit'
do
...
@@ -320,7 +320,7 @@ describe Notify do
...
@@ -320,7 +320,7 @@ describe Notify do
it_behaves_like
'a note email'
it_behaves_like
'a note email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
n
ote for merge request #
#{
merge_request
.
iid
}
/
should
have_subject
/
N
ote for merge request #
#{
merge_request
.
iid
}
/
end
end
it
'contains a link to the merge request note'
do
it
'contains a link to the merge request note'
do
...
@@ -338,7 +338,7 @@ describe Notify do
...
@@ -338,7 +338,7 @@ describe Notify do
it_behaves_like
'a note email'
it_behaves_like
'a note email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
n
ote for issue #
#{
issue
.
iid
}
/
should
have_subject
/
N
ote for issue #
#{
issue
.
iid
}
/
end
end
it
'contains a link to the issue note'
do
it
'contains a link to the issue note'
do
...
@@ -356,7 +356,7 @@ describe Notify do
...
@@ -356,7 +356,7 @@ describe Notify do
subject
{
Notify
.
group_access_granted_email
(
membership
.
id
)
}
subject
{
Notify
.
group_access_granted_email
(
membership
.
id
)
}
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
a
ccess to group was granted/
should
have_subject
/
A
ccess to group was granted/
end
end
it
'contains name of project'
do
it
'contains name of project'
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录