BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
29a6f0d2
Commit
29a6f0d2
authored
Oct 14, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce more GitLab routing helpers, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6019#note_16852207
parent
36aea928
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
14 deletions
+46
-14
gitlab_routing_helper.rb
app/helpers/gitlab_routing_helper.rb
+32
-0
pipeline_failed_email.html.haml
app/views/notify/pipeline_failed_email.html.haml
+4
-4
pipeline_failed_email.text.erb
app/views/notify/pipeline_failed_email.text.erb
+4
-4
pipeline_success_email.html.haml
app/views/notify/pipeline_success_email.html.haml
+3
-3
pipeline_success_email.text.erb
app/views/notify/pipeline_success_email.text.erb
+3
-3
No files found.
app/helpers/gitlab_routing_helper.rb
View file @
29a6f0d2
...
@@ -94,6 +94,38 @@ module GitlabRoutingHelper
...
@@ -94,6 +94,38 @@ module GitlabRoutingHelper
namespace_project_merge_request_url
(
entity
.
project
.
namespace
,
entity
.
project
,
entity
,
*
args
)
namespace_project_merge_request_url
(
entity
.
project
.
namespace
,
entity
.
project
,
entity
,
*
args
)
end
end
def
pipeline_url
(
pipeline
,
*
args
)
namespace_project_pipeline_url
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
pipeline
.
id
,
*
args
)
end
def
pipeline_build_url
(
pipeline
,
build
,
*
args
)
namespace_project_build_url
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
build
.
id
,
*
args
)
end
def
commits_url
(
entity
,
*
args
)
namespace_project_commits_url
(
entity
.
project
.
namespace
,
entity
.
project
,
entity
.
ref
,
*
args
)
end
def
commit_url
(
entity
,
*
args
)
namespace_project_commit_url
(
entity
.
project
.
namespace
,
entity
.
project
,
entity
.
sha
,
*
args
)
end
def
project_snippet_url
(
entity
,
*
args
)
def
project_snippet_url
(
entity
,
*
args
)
namespace_project_snippet_url
(
entity
.
project
.
namespace
,
entity
.
project
,
entity
,
*
args
)
namespace_project_snippet_url
(
entity
.
project
.
namespace
,
entity
.
project
,
entity
,
*
args
)
end
end
...
...
app/views/notify/pipeline_failed_email.html.haml
View file @
29a6f0d2
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;"
}
%img
{
height:
"13"
,
src:
image_url
(
'mailers/ci_pipeline_notif_v1/icon-branch-gray.gif'
),
style:
"display:block;"
,
width:
"13"
}
/
%img
{
height:
"13"
,
src:
image_url
(
'mailers/ci_pipeline_notif_v1/icon-branch-gray.gif'
),
style:
"display:block;"
,
width:
"13"
}
/
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;"
}
%a
.muted
{
href:
namespace_project_commits_url
(
@project
.
namespace
,
@project
,
@pipeline
.
ref
),
style:
"color:#333333;text-decoration:none;"
}
%a
.muted
{
href:
commits_url
(
@pipeline
),
style:
"color:#333333;text-decoration:none;"
}
=
@pipeline
.
ref
=
@pipeline
.
ref
%tr
%tr
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;border-top:1px solid #ededed;"
}
Commit
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;border-top:1px solid #ededed;"
}
Commit
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;"
}
%img
{
height:
"13"
,
src:
image_url
(
'mailers/ci_pipeline_notif_v1/icon-commit-gray.gif'
),
style:
"display:block;"
,
width:
"13"
}
/
%img
{
height:
"13"
,
src:
image_url
(
'mailers/ci_pipeline_notif_v1/icon-commit-gray.gif'
),
style:
"display:block;"
,
width:
"13"
}
/
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;"
}
%a
{
href:
namespace_project_commit_url
(
@project
.
namespace
,
@project
,
@pipeline
.
sha
),
style:
"color:#3084bb;text-decoration:none;"
}
%a
{
href:
commit_url
(
@pipeline
),
style:
"color:#3084bb;text-decoration:none;"
}
=
@pipeline
.
short_sha
=
@pipeline
.
short_sha
-
if
@merge_request
-
if
@merge_request
in
in
...
@@ -134,7 +134,7 @@
...
@@ -134,7 +134,7 @@
%tr
.pre-section
%tr
.pre-section
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#333333;font-size:15px;font-weight:400;line-height:1.4;padding:15px 0;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#333333;font-size:15px;font-weight:400;line-height:1.4;padding:15px 0;"
}
Pipeline
Pipeline
%a
{
href:
namespace_project_pipeline_url
(
@project
.
namespace
,
@project
,
@pipeline
.
id
),
style:
"color:#3084bb;text-decoration:none;"
}
%a
{
href:
pipeline_url
(
@pipeline
),
style:
"color:#3084bb;text-decoration:none;"
}
=
"
\#
#{
@pipeline
.
id
}
"
=
"
\#
#{
@pipeline
.
id
}
"
had
had
=
failed
.
size
=
failed
.
size
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#8c8c8c;font-weight:500;font-size:15px;vertical-align:middle;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#8c8c8c;font-weight:500;font-size:15px;vertical-align:middle;"
}
=
build
.
stage
=
build
.
stage
%td
{
align:
"right"
,
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:20px 0;color:#8c8c8c;font-weight:500;font-size:15px;"
}
%td
{
align:
"right"
,
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:20px 0;color:#8c8c8c;font-weight:500;font-size:15px;"
}
%a
{
href:
namespace_project_build_url
(
@project
.
namespace
,
@project
,
build
.
i
d
),
style:
"color:#3084bb;text-decoration:none;"
}
%a
{
href:
pipeline_build_url
(
@pipeline
,
buil
d
),
style:
"color:#3084bb;text-decoration:none;"
}
=
build
.
name
=
build
.
name
%tr
.build-log
%tr
.build-log
%td
{
colspan:
"2"
,
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:0 0 15px;"
}
%td
{
colspan:
"2"
,
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding:0 0 15px;"
}
...
...
app/views/notify/pipeline_failed_email.text.erb
View file @
29a6f0d2
Your pipeline has failed.
Your pipeline has failed.
Project:
<%=
@project
.
name
%>
(
<%=
project_url
(
@project
)
%>
)
Project:
<%=
@project
.
name
%>
(
<%=
project_url
(
@project
)
%>
)
Branch:
<%=
@pipeline
.
ref
%>
(
<%=
namespace_project_commits_url
(
@project
.
namespace
,
@project
,
@pipeline
.
ref
)
%>
)
Branch:
<%=
@pipeline
.
ref
%>
(
<%=
commits_url
(
@pipeline
)
%>
)
<%
if
@merge_request
-%>
<%
if
@merge_request
-%>
Merge Request:
<%=
@merge_request
.
to_reference
%>
(
<%=
merge_request_url
(
@merge_request
)
%>
)
Merge Request:
<%=
@merge_request
.
to_reference
%>
(
<%=
merge_request_url
(
@merge_request
)
%>
)
<%
end
-%>
<%
end
-%>
Commit:
<%=
@pipeline
.
short_sha
%>
(
<%=
namespace_project_commit_url
(
@project
.
namespace
,
@project
,
@pipeline
.
sha
)
%>
)
Commit:
<%=
@pipeline
.
short_sha
%>
(
<%=
commit_url
(
@pipeline
)
%>
)
Commit Message:
<%=
@pipeline
.
git_commit_message
.
truncate
(
50
)
%>
Commit Message:
<%=
@pipeline
.
git_commit_message
.
truncate
(
50
)
%>
<%
commit
=
@pipeline
.
commit
-%>
<%
commit
=
@pipeline
.
commit
-%>
<%
if
commit
.
author
-%>
<%
if
commit
.
author
-%>
...
@@ -16,10 +16,10 @@ Commit Author: <%= commit.author_name %>
...
@@ -16,10 +16,10 @@ Commit Author: <%= commit.author_name %>
<%
end
-%>
<%
end
-%>
<%
failed
=
@pipeline
.
statuses
.
latest
.
failed
-%>
<%
failed
=
@pipeline
.
statuses
.
latest
.
failed
-%>
Pipeline #
<%=
@pipeline
.
id
%>
(
<%=
namespace_project_pipeline_url
(
@project
.
namespace
,
@project
,
@pipeline
.
id
)
%>
) had
<%=
failed
.
size
%>
failed
<%=
'build'
.
pluralize
(
failed
.
size
)
%>
.
Pipeline #
<%=
@pipeline
.
id
%>
(
<%=
pipeline_url
(
@pipeline
)
%>
) had
<%=
failed
.
size
%>
failed
<%=
'build'
.
pluralize
(
failed
.
size
)
%>
.
<%
failed
.
each
do
|
build
|
-%>
<%
failed
.
each
do
|
build
|
-%>
Build #
<%=
build
.
id
%>
(
<%=
namespace_project_build_url
(
@project
.
namespace
,
@project
,
build
.
i
d
)
%>
)
Build #
<%=
build
.
id
%>
(
<%=
pipeline_build_url
(
@pipeline
,
buil
d
)
%>
)
Stage:
<%=
build
.
stage
%>
Stage:
<%=
build
.
stage
%>
Name:
<%=
build
.
name
%>
Name:
<%=
build
.
name
%>
Trace:
<%=
build
.
trace_with_state
(
last_lines:
10
)[
:text
]
%>
Trace:
<%=
build
.
trace_with_state
(
last_lines:
10
)[
:text
]
%>
...
...
app/views/notify/pipeline_success_email.html.haml
View file @
29a6f0d2
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;"
}
%img
{
height:
"13"
,
src:
image_url
(
'mailers/ci_pipeline_notif_v1/icon-branch-gray.gif'
),
style:
"display:block;"
,
width:
"13"
}
/
%img
{
height:
"13"
,
src:
image_url
(
'mailers/ci_pipeline_notif_v1/icon-branch-gray.gif'
),
style:
"display:block;"
,
width:
"13"
}
/
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;"
}
%a
.muted
{
href:
namespace_project_commits_url
(
@project
.
namespace
,
@project
,
@pipeline
.
ref
),
style:
"color:#333333;text-decoration:none;"
}
%a
.muted
{
href:
commits_url
(
@pipeline
),
style:
"color:#333333;text-decoration:none;"
}
=
@pipeline
.
ref
=
@pipeline
.
ref
%tr
%tr
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;border-top:1px solid #ededed;"
}
Commit
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;color:#8c8c8c;font-weight:300;padding:14px 0;margin:0;border-top:1px solid #ededed;"
}
Commit
...
@@ -103,7 +103,7 @@
...
@@ -103,7 +103,7 @@
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;padding-right:5px;"
}
%img
{
height:
"13"
,
src:
image_url
(
'mailers/ci_pipeline_notif_v1/icon-commit-gray.gif'
),
style:
"display:block;"
,
width:
"13"
}
/
%img
{
height:
"13"
,
src:
image_url
(
'mailers/ci_pipeline_notif_v1/icon-commit-gray.gif'
),
style:
"display:block;"
,
width:
"13"
}
/
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;"
}
%td
{
style:
"font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:1.4;vertical-align:middle;"
}
%a
{
href:
namespace_project_commit_url
(
@project
.
namespace
,
@project
,
@pipeline
.
sha
),
style:
"color:#3084bb;text-decoration:none;"
}
%a
{
href:
commit_url
(
@pipeline
),
style:
"color:#3084bb;text-decoration:none;"
}
=
@pipeline
.
short_sha
=
@pipeline
.
short_sha
-
if
@merge_request
-
if
@merge_request
in
in
...
@@ -135,7 +135,7 @@
...
@@ -135,7 +135,7 @@
-
build_count
=
@pipeline
.
statuses
.
latest
.
size
-
build_count
=
@pipeline
.
statuses
.
latest
.
size
-
stage_count
=
@pipeline
.
stages
.
size
-
stage_count
=
@pipeline
.
stages
.
size
Pipeline
Pipeline
%a
{
href:
namespace_project_pipeline_url
(
@project
.
namespace
,
@project
,
@pipeline
.
id
),
style:
"color:#3084bb;text-decoration:none;"
}
%a
{
href:
pipeline_url
(
@pipeline
),
style:
"color:#3084bb;text-decoration:none;"
}
=
"
\#
#{
@pipeline
.
id
}
"
=
"
\#
#{
@pipeline
.
id
}
"
successfully completed
successfully completed
=
"
#{
build_count
}
#{
'build'
.
pluralize
(
build_count
)
}
"
=
"
#{
build_count
}
#{
'build'
.
pluralize
(
build_count
)
}
"
...
...
app/views/notify/pipeline_success_email.text.erb
View file @
29a6f0d2
Your pipeline has passed.
Your pipeline has passed.
Project:
<%=
@project
.
name
%>
(
<%=
project_url
(
@project
)
%>
)
Project:
<%=
@project
.
name
%>
(
<%=
project_url
(
@project
)
%>
)
Branch:
<%=
@pipeline
.
ref
%>
(
<%=
namespace_project_commits_url
(
@project
.
namespace
,
@project
,
@pipeline
.
ref
)
%>
)
Branch:
<%=
@pipeline
.
ref
%>
(
<%=
commits_url
(
@pipeline
.
ref
)
%>
)
<%
if
@merge_request
-%>
<%
if
@merge_request
-%>
Merge Request:
<%=
@merge_request
.
to_reference
%>
(
<%=
merge_request_url
(
@merge_request
)
%>
)
Merge Request:
<%=
@merge_request
.
to_reference
%>
(
<%=
merge_request_url
(
@merge_request
)
%>
)
<%
end
-%>
<%
end
-%>
Commit:
<%=
@pipeline
.
short_sha
%>
(
<%=
namespace_project_commit_url
(
@project
.
namespace
,
@project
,
@pipeline
.
sha
)
%>
)
Commit:
<%=
@pipeline
.
short_sha
%>
(
<%=
commit_url
(
@pipeline
)
%>
)
Commit Message:
<%=
@pipeline
.
git_commit_message
.
truncate
(
50
)
%>
Commit Message:
<%=
@pipeline
.
git_commit_message
.
truncate
(
50
)
%>
<%
commit
=
@pipeline
.
commit
-%>
<%
commit
=
@pipeline
.
commit
-%>
<%
if
commit
.
author
-%>
<%
if
commit
.
author
-%>
...
@@ -17,7 +17,7 @@ Commit Author: <%= commit.author_name %>
...
@@ -17,7 +17,7 @@ Commit Author: <%= commit.author_name %>
<%
build_count
=
@pipeline
.
statuses
.
latest
.
size
-%>
<%
build_count
=
@pipeline
.
statuses
.
latest
.
size
-%>
<%
stage_count
=
@pipeline
.
stages
.
size
-%>
<%
stage_count
=
@pipeline
.
stages
.
size
-%>
Pipeline #
<%=
@pipeline
.
id
%>
(
<%=
namespace_project_pipeline_url
(
@project
.
namespace
,
@project
,
@pipeline
.
id
)
%>
) successfully completed
<%=
build_count
%>
<%=
'build'
.
pluralize
(
build_count
)
%>
in
<%=
stage_count
%>
<%=
'stage'
.
pluralize
(
stage_count
)
%>
.
Pipeline #
<%=
@pipeline
.
id
%>
(
<%=
pipeline_url
(
@pipeline
)
%>
) successfully completed
<%=
build_count
%>
<%=
'build'
.
pluralize
(
build_count
)
%>
in
<%=
stage_count
%>
<%=
'stage'
.
pluralize
(
stage_count
)
%>
.
You're receiving this email because of your account on
<%=
Gitlab
.
config
.
gitlab
.
host
%>
.
You're receiving this email because of your account on
<%=
Gitlab
.
config
.
gitlab
.
host
%>
.
Manage all notifications:
<%=
profile_notifications_url
%>
Manage all notifications:
<%=
profile_notifications_url
%>
...
...
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