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
Boxiang Sun
gitlab-ce
Commits
c351b9f5
Commit
c351b9f5
authored
Apr 13, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve rendered CI statuses
parent
410f2b40
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
14 deletions
+23
-14
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+18
-9
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+1
-1
app/views/projects/issues/_merge_requests.html.haml
app/views/projects/issues/_merge_requests.html.haml
+1
-1
app/views/projects/issues/_related_branches.html.haml
app/views/projects/issues/_related_branches.html.haml
+1
-1
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+1
-1
app/views/shared/projects/_project.html.haml
app/views/shared/projects/_project.html.haml
+1
-1
No files found.
app/helpers/ci_status_helper.rb
View file @
c351b9f5
...
...
@@ -38,14 +38,23 @@ module CiStatusHelper
icon
(
icon_name
+
' fw'
)
end
def
render_ci_status
(
ci_commit
,
tooltip_placement:
'auto left'
)
# TODO: split this method into
# - render_commit_status
# - render_pipeline_status
link_to
ci_icon_for_status
(
ci_commit
.
status
),
ci_status_path
(
ci_commit
),
class:
"ci-status-link ci-status-icon-
#{
ci_commit
.
status
.
dasherize
}
"
,
title:
"Build
#{
ci_label_for_status
(
ci_commit
.
status
)
}
"
,
def
render_commit_status
(
commit
,
tooltip_placement:
'auto left'
)
project
=
commit
.
project
path
=
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
render_status_with_link
(
'commit'
,
commit
.
status
,
path
,
tooltip_placement
)
end
def
render_pipeline_status
(
pipeline
,
tooltip_placement:
'auto left'
)
project
=
pipeline
.
project
path
=
namespace_project_pipeline_path
(
project
.
namespace
,
project
,
pipeline
)
render_status_with_link
(
'pipeline'
,
pipeline
.
status
,
path
,
tooltip_placement
)
end
def
render_status_with_link
(
type
,
status
,
path
,
tooltip_placement
)
link_to
ci_icon_for_status
(
status
),
path
,
class:
"ci-status-link ci-status-icon-
#{
status
.
dasherize
}
"
,
title:
"
#{
type
.
titleize
}
:
#{
ci_label_for_status
(
status
)
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
tooltip_placement
}
end
...
...
app/views/projects/commits/_commit.html.haml
View file @
c351b9f5
...
...
@@ -17,7 +17,7 @@
.pull-right
-
if
commit
.
status
=
render_c
i
_status
(
commit
)
=
render_c
ommit
_status
(
commit
)
=
clipboard_button
(
clipboard_text:
commit
.
id
)
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit_short_id"
...
...
app/views/projects/issues/_merge_requests.html.haml
View file @
c351b9f5
...
...
@@ -7,7 +7,7 @@
%li
%span
.merge-request-ci-status
-
if
merge_request
.
ci_commit
=
render_
ci
_status
(
merge_request
.
ci_commit
)
=
render_
pipeline
_status
(
merge_request
.
ci_commit
)
-
elsif
has_any_ci
=
icon
(
'blank fw'
)
%span
.merge-request-id
...
...
app/views/projects/issues/_related_branches.html.haml
View file @
c351b9f5
...
...
@@ -8,7 +8,7 @@
-
ci_commit
=
@project
.
ci_commit
(
sha
,
branch
)
if
sha
-
if
ci_commit
%span
.related-branch-ci-status
=
render_
ci
_status
(
ci_commit
)
=
render_
pipeline
_status
(
ci_commit
)
%span
.related-branch-info
%strong
=
link_to
namespace_project_compare_path
(
@project
.
namespace
,
@project
,
from:
@project
.
default_branch
,
to:
branch
),
class:
"label-branch"
do
...
...
app/views/projects/merge_requests/_merge_request.html.haml
View file @
c351b9f5
...
...
@@ -13,7 +13,7 @@
-
if
merge_request
.
ci_commit
%li
=
render_
ci
_status
(
merge_request
.
ci_commit
)
=
render_
pipeline
_status
(
merge_request
.
ci_commit
)
-
if
merge_request
.
open?
&&
merge_request
.
broken?
%li
...
...
app/views/shared/projects/_project.html.haml
View file @
c351b9f5
...
...
@@ -17,7 +17,7 @@
=
project
.
main_language
-
if
project
.
commit
.
try
(
:status
)
%span
=
render_c
i
_status
(
project
.
commit
)
=
render_c
ommit
_status
(
project
.
commit
)
-
if
forks
%span
=
icon
(
'code-fork'
)
...
...
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