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
Tatuya Kamada
gitlab-ce
Commits
49e7070a
Commit
49e7070a
authored
Aug 17, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for Play and Created jobs
parent
ae5ec791
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
35 deletions
+41
-35
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+17
-9
app/views/projects/ci/builds/_build_pipeline.html.haml
app/views/projects/ci/builds/_build_pipeline.html.haml
+12
-10
app/views/projects/commit/_pipeline.html.haml
app/views/projects/commit/_pipeline.html.haml
+5
-9
app/views/projects/generic_commit_statuses/_generic_commit_status_pipeline.html.haml
...commit_statuses/_generic_commit_status_pipeline.html.haml
+7
-7
No files found.
app/helpers/ci_status_helper.rb
View file @
49e7070a
...
@@ -38,6 +38,10 @@ module CiStatusHelper
...
@@ -38,6 +38,10 @@ module CiStatusHelper
'icon_status_pending'
'icon_status_pending'
when
'running'
when
'running'
'icon_status_running'
'icon_status_running'
when
'play'
'icon_status_warning'
when
'created'
'icon_status_pending'
else
else
'icon_status_cancel'
'icon_status_cancel'
end
end
...
@@ -48,13 +52,13 @@ module CiStatusHelper
...
@@ -48,13 +52,13 @@ module CiStatusHelper
def
render_commit_status
(
commit
,
tooltip_placement:
'auto left'
)
def
render_commit_status
(
commit
,
tooltip_placement:
'auto left'
)
project
=
commit
.
project
project
=
commit
.
project
path
=
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
path
=
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
render_status_with_link
(
'commit'
,
commit
.
status
,
path
,
tooltip_placement
)
render_status_with_link
(
'commit'
,
commit
.
status
,
path
,
tooltip_placement
:
tooltip_placement
)
end
end
def
render_pipeline_status
(
pipeline
,
tooltip_placement:
'auto left'
)
def
render_pipeline_status
(
pipeline
,
tooltip_placement:
'auto left'
)
project
=
pipeline
.
project
project
=
pipeline
.
project
path
=
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
path
=
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
render_status_with_link
(
'pipeline'
,
pipeline
.
status
,
path
,
tooltip_placement
)
render_status_with_link
(
'pipeline'
,
pipeline
.
status
,
path
,
tooltip_placement
:
tooltip_placement
)
end
end
def
no_runners_for_project?
(
project
)
def
no_runners_for_project?
(
project
)
...
@@ -62,13 +66,17 @@ module CiStatusHelper
...
@@ -62,13 +66,17 @@ module CiStatusHelper
Ci
::
Runner
.
shared
.
blank?
Ci
::
Runner
.
shared
.
blank?
end
end
private
def
render_status_with_link
(
type
,
status
,
path
=
nil
,
tooltip_placement:
'auto left'
,
cssclass:
''
)
klass
=
"ci-status-link ci-status-icon-
#{
status
.
dasherize
}
#{
cssclass
}
"
title
=
"
#{
type
.
titleize
}
:
#{
ci_label_for_status
(
status
)
}
"
data
=
{
toggle:
'tooltip'
,
placement:
tooltip_placement
}
def
render_status_with_link
(
type
,
status
,
path
,
tooltip_placement
,
cssclass:
''
)
if
path
link_to
ci_icon_for_status
(
status
),
link_to
ci_icon_for_status
(
status
),
path
,
path
,
class:
klass
,
title:
title
,
data:
data
class:
"ci-status-link ci-status-icon-
#{
status
.
dasherize
}
#{
cssclass
}
"
,
else
title:
"
#{
type
.
titleize
}
:
#{
ci_label_for_status
(
status
)
}
"
,
content_tag
:span
,
ci_icon_for_status
(
status
),
data:
{
toggle:
'tooltip'
,
placement:
tooltip_placement
}
class:
klass
,
title:
title
,
data:
data
end
end
end
end
end
app/views/projects/ci/builds/_build_pipeline.html.haml
View file @
49e7070a
%li
.build
%li
.build
.build-content
.build-content
%span
{
class:
"ci-status-link ci-status-icon-#{subject.status}"
}
-
if
subject
.
playable?
&&
can?
(
current_user
,
:update_build
,
@project
)
-
if
subject
.
playable?
&&
can?
(
current_user
,
:update_build
,
@project
)
=
link_to
play_namespace_project_build_path
(
subject
.
project
.
namespace
,
subject
.
project
,
subject
,
return_to:
request
.
original_url
),
method: :post
,
title:
'Play'
do
=
link_to
play_namespace_project_build_path
(
subject
.
project
.
namespace
,
subject
.
project
,
subject
,
return_to:
request
.
original_url
),
method: :post
,
title:
'Play'
do
=
icon
(
'play'
)
=
render_status_with_link
(
'build'
,
'play'
)
-
elsif
can?
(
current_user
,
:read_build
,
@project
)
&&
subject
.
started?
=
subject
.
name
-
elsif
can?
(
current_user
,
:read_build
,
@project
)
=
link_to
namespace_project_build_path
(
subject
.
project
.
namespace
,
subject
.
project
,
subject
)
do
=
link_to
namespace_project_build_path
(
subject
.
project
.
namespace
,
subject
.
project
,
subject
)
do
=
ci_icon_for_status
(
subject
.
status
)
=
render_status_with_link
(
'build'
,
subject
.
status
)
=
subject
.
name
-
else
-
else
=
render_status_with_link
(
'build'
,
subject
.
status
)
=
ci_icon_for_status
(
subject
.
status
)
=
ci_icon_for_status
(
subject
.
status
)
=
subject
.
name
app/views/projects/commit/_pipeline.html.haml
View file @
49e7070a
...
@@ -30,9 +30,8 @@
...
@@ -30,9 +30,8 @@
.row-content-block.build-content.middle-block.pipeline-graph
.row-content-block.build-content.middle-block.pipeline-graph
.pipeline-visualization
.pipeline-visualization
%ul
.stage-column-list
%ul
.stage-column-list
-
pipeline
.
statuses
.
stages
.
each
do
|
stage
|
-
stages
=
pipeline
.
stages_with_latest_statuses
-
statuses
=
pipeline
.
statuses
.
where
(
stage:
stage
)
-
stages
.
each
do
|
stage
,
statuses
|
-
status
=
statuses
.
latest
.
status
%li
.stage-column
%li
.stage-column
.stage-name
.stage-name
%a
{
name:
stage
}
%a
{
name:
stage
}
...
@@ -40,12 +39,9 @@
...
@@ -40,12 +39,9 @@
=
stage
.
titleize
=
stage
.
titleize
.builds-container
.builds-container
%ul
%ul
-
statuses
.
each
do
|
build
|
-
statuses
.
each
do
|
status
|
%li
.build
=
render
"projects/
#{
status
.
to_partial_path
}
_pipeline"
,
subject:
status
.build-content
%span
{
class:
"ci-status-link ci-status-icon-#{status}"
}
=
ci_icon_for_status
(
status
)
=
link_to
build
.
name
,
namespace_project_build_url
(
build
.
project
.
namespace
,
build
.
project
,
build
)
-
if
pipeline
.
yaml_errors
.
present?
-
if
pipeline
.
yaml_errors
.
present?
.bs-callout.bs-callout-danger
.bs-callout.bs-callout-danger
...
...
app/views/projects/generic_commit_statuses/_generic_commit_status_pipeline.html.haml
View file @
49e7070a
%li
.build
%li
.build
.build-content
.build-content
%span
{
class:
"ci-status-link ci-status-icon-#{subject.status}"
}
-
if
subject
.
target_url
-
if
subject
.
target_url
-
link_to
subject
.
target_url
do
-
link_to
subject
.
target_url
do
=
ci_icon_for_status
(
subject
.
status
)
=
render_status_with_link
(
'commit status'
,
subject
.
status
)
=
subject
.
name
-
else
-
else
=
ci_icon_for_status
(
subject
.
status
)
=
render_status_with_link
(
'commit status'
,
subject
.
status
)
=
subject
.
name
=
subject
.
name
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