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
Kazuhiko Shiozaki
gitlab-ce
Commits
ffe064a2
Commit
ffe064a2
authored
Dec 31, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bit of cleanup and improving mailer
parent
cf3f22cc
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
13 deletions
+16
-13
app/mailers/notify.rb
app/mailers/notify.rb
+5
-2
app/views/layouts/notify.html.haml
app/views/layouts/notify.html.haml
+2
-2
app/views/notify/issue_status_changed_email.html.haml
app/views/notify/issue_status_changed_email.html.haml
+2
-2
app/views/notify/new_issue_email.html.haml
app/views/notify/new_issue_email.html.haml
+4
-4
app/views/notify/note_merge_request_email.html.haml
app/views/notify/note_merge_request_email.html.haml
+1
-1
app/views/notify/reassigned_issue_email.html.haml
app/views/notify/reassigned_issue_email.html.haml
+1
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+1
-1
No files found.
app/mailers/notify.rb
View file @
ffe064a2
...
@@ -148,12 +148,15 @@ class Notify < ActionMailer::Base
...
@@ -148,12 +148,15 @@ class Notify < ActionMailer::Base
# >> @project = Project.last
# >> @project = Project.last
# => #<Project id: 1, name: "Ruby on Rails", path: "ruby_on_rails", ...>
# => #<Project id: 1, name: "Ruby on Rails", path: "ruby_on_rails", ...>
# >> subject('Lorem ipsum')
# >> subject('Lorem ipsum')
# => "GitLab |
Lorem ipsum | Ruby on Rails
"
# => "GitLab |
Ruby on Rails | Lorem ipsum
"
#
#
# # Accepts multiple arguments
# # Accepts multiple arguments
# >> subject('Lorem ipsum', 'Dolor sit amet')
# >> subject('Lorem ipsum', 'Dolor sit amet')
# => "GitLab | Lorem ipsum | Dolor sit amet"
# => "GitLab | Lorem ipsum | Dolor sit amet"
def
subject
(
*
extra
)
def
subject
(
*
extra
)
"GitLab | "
<<
extra
.
join
(
' | '
)
<<
(
@project
?
" |
#{
@project
.
name_with_namespace
}
"
:
""
)
subject
=
"GitLab"
subject
<<
(
@project
?
" |
#{
@project
.
name_with_namespace
}
"
:
""
)
subject
<<
" | "
+
extra
.
join
(
' | '
)
if
extra
.
present?
subject
end
end
end
end
app/views/layouts/notify.html.haml
View file @
ffe064a2
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
%td
{
style:
"font-size: 0px;"
,
width:
"20"
}
%td
{
style:
"font-size: 0px;"
,
width:
"20"
}
\
\
%td
{
align:
"left"
,
style:
"padding: 10px 0"
,
width:
"580"
}
%td
{
align:
"left"
,
style:
"padding: 10px 0"
,
width:
"580"
}
%h1
{
style:
"
font-size: 24px; color: #BBBBBB; font: normal 22
px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 32px;"
}
%h1
{
style:
"
color: #BBBBBB; font: normal 20
px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 32px;"
}
GITLAB
GITLAB
-
if
@project
-
if
@project
→
#{
@project
.
name_with_namespace
}
\/
#{
@project
.
name_with_namespace
}
%table
{
align:
"center"
,
bgcolor:
"#fff"
,
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"font-family: Helvetica, Arial, sans-serif; background: #fff;"
,
width:
"600"
}
%table
{
align:
"center"
,
bgcolor:
"#fff"
,
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"font-family: Helvetica, Arial, sans-serif; background: #fff;"
,
width:
"600"
}
%tr
=
yield
%tr
=
yield
%tr
%tr
...
...
app/views/notify/issue_status_changed_email.html.haml
View file @
ffe064a2
%td
.content
{
align:
"left"
,
style:
"font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;"
,
valign:
"top"
,
width:
"600"
}
%td
.content
{
align:
"left"
,
style:
"font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;"
,
valign:
"top"
,
width:
"600"
}
%table
{
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;"
,
width:
"600"
}
%table
{
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;"
,
width:
"600"
}
%tr
%tr
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%td
{
width:
"21"
}
%td
{
align:
"left"
,
style:
"padding: 20px 0 0;"
}
%td
%h2
{
style:
"color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "
}
%h2
{
style:
"color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "
}
=
"Issue was
#{
@issue_status
}
by
#{
@updated_by
.
name
}
"
=
"Issue was
#{
@issue_status
}
by
#{
@updated_by
.
name
}
"
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
...
...
app/views/notify/new_issue_email.html.haml
View file @
ffe064a2
%td
.content
{
align:
"left"
,
style:
"font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;"
,
valign:
"top"
,
width:
"600"
}
%td
.content
{
align:
"left"
,
style:
"font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;"
,
valign:
"top"
,
width:
"600"
}
%table
{
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;"
,
width:
"600"
}
%table
{
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;"
,
width:
"600"
}
%tr
%tr
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%td
{
width:
"21"
}
%td
{
align:
"left"
,
style:
"padding: 20px 0 0;"
}
%td
%h2
{
style:
"color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "
}
%h2
{
style:
"color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "
}
New Issue was created and assigned to you.
New Issue was created and assigned to you.
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%td
{
width:
"21"
}
%tr
%tr
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%td
{
width:
"21"
}
%td
{
align:
"left"
,
style:
"padding: 20px 0 0;"
}
%td
{
align:
"left"
,
style:
"padding: 20px 0 0;"
}
%p
{
style:
"color:#646464 !important; line-height: 26px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; "
}
%p
{
style:
"color:#646464 !important; line-height: 26px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; "
}
=
"Issue #
#{
@issue
.
id
}
"
=
"Issue #
#{
@issue
.
id
}
"
...
...
app/views/notify/note_merge_request_email.html.haml
View file @
ffe064a2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
%table
{
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;"
,
width:
"600"
}
%table
{
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;"
,
width:
"600"
}
%tr
%tr
%td
{
width:
"21"
}
%td
{
width:
"21"
}
%td
{
align:
"left"
,
style:
"padding: 20px 0 0;"
}
%td
%h2
{
style:
"color:#646464; font-weight: normal;"
}
%h2
{
style:
"color:#646464; font-weight: normal;"
}
-
if
@note
.
for_diff_line?
-
if
@note
.
for_diff_line?
=
link_to
"New comment on diff"
,
diffs_project_merge_request_url
(
@merge_request
.
project
,
@merge_request
,
anchor:
"note_
#{
@note
.
id
}
"
)
=
link_to
"New comment on diff"
,
diffs_project_merge_request_url
(
@merge_request
.
project
,
@merge_request
,
anchor:
"note_
#{
@note
.
id
}
"
)
...
...
app/views/notify/reassigned_issue_email.html.haml
View file @
ffe064a2
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
%table
{
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;"
,
width:
"600"
}
%table
{
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;"
,
width:
"600"
}
%tr
%tr
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%td
{
align:
"left"
,
style:
"padding: 20px 0 0;"
}
%td
%h2
{
style:
"color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "
}
%h2
{
style:
"color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "
}
=
"Reassigned Issue #
#{
@issue
.
id
}
"
=
"Reassigned Issue #
#{
@issue
.
id
}
"
=
link_to_gfm
truncate
(
@issue
.
title
,
length:
30
),
project_issue_url
(
@issue
.
project
,
@issue
)
=
link_to_gfm
truncate
(
@issue
.
title
,
length:
30
),
project_issue_url
(
@issue
.
project
,
@issue
)
...
...
spec/mailers/notify_spec.rb
View file @
ffe064a2
...
@@ -60,7 +60,7 @@ describe Notify do
...
@@ -60,7 +60,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 issue #
#{
issue
.
id
}
\|
#{
issue
.
title
}
\|
#{
project
.
nam
e
}
/
should
have_subject
/
#{
project
.
name
}
\| new issue #
#{
issue
.
id
}
\|
#{
issue
.
titl
e
}
/
end
end
it
'contains a link to the new issue'
do
it
'contains a link to the new issue'
do
...
...
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