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
Jérome Perrin
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
Hide 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,15 +38,24 @@ module CiStatusHelper
...
@@ -38,15 +38,24 @@ module CiStatusHelper
icon
(
icon_name
+
' fw'
)
icon
(
icon_name
+
' fw'
)
end
end
def
render_ci_status
(
ci_commit
,
tooltip_placement:
'auto left'
)
def
render_commit_status
(
commit
,
tooltip_placement:
'auto left'
)
# TODO: split this method into
project
=
commit
.
project
# - render_commit_status
path
=
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
# - render_pipeline_status
render_status_with_link
(
'commit'
,
commit
.
status
,
path
,
tooltip_placement
)
link_to
ci_icon_for_status
(
ci_commit
.
status
),
end
ci_status_path
(
ci_commit
),
class:
"ci-status-link ci-status-icon-
#{
ci_commit
.
status
.
dasherize
}
"
,
def
render_pipeline_status
(
pipeline
,
tooltip_placement:
'auto left'
)
title:
"Build
#{
ci_label_for_status
(
ci_commit
.
status
)
}
"
,
project
=
pipeline
.
project
data:
{
toggle:
'tooltip'
,
placement:
tooltip_placement
}
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
end
def
no_runners_for_project?
(
project
)
def
no_runners_for_project?
(
project
)
...
...
app/views/projects/commits/_commit.html.haml
View file @
c351b9f5
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
.pull-right
.pull-right
-
if
commit
.
status
-
if
commit
.
status
=
render_c
i
_status
(
commit
)
=
render_c
ommit
_status
(
commit
)
=
clipboard_button
(
clipboard_text:
commit
.
id
)
=
clipboard_button
(
clipboard_text:
commit
.
id
)
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit_short_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 @@
...
@@ -7,7 +7,7 @@
%li
%li
%span
.merge-request-ci-status
%span
.merge-request-ci-status
-
if
merge_request
.
ci_commit
-
if
merge_request
.
ci_commit
=
render_
ci
_status
(
merge_request
.
ci_commit
)
=
render_
pipeline
_status
(
merge_request
.
ci_commit
)
-
elsif
has_any_ci
-
elsif
has_any_ci
=
icon
(
'blank fw'
)
=
icon
(
'blank fw'
)
%span
.merge-request-id
%span
.merge-request-id
...
...
app/views/projects/issues/_related_branches.html.haml
View file @
c351b9f5
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
-
ci_commit
=
@project
.
ci_commit
(
sha
,
branch
)
if
sha
-
ci_commit
=
@project
.
ci_commit
(
sha
,
branch
)
if
sha
-
if
ci_commit
-
if
ci_commit
%span
.related-branch-ci-status
%span
.related-branch-ci-status
=
render_
ci
_status
(
ci_commit
)
=
render_
pipeline
_status
(
ci_commit
)
%span
.related-branch-info
%span
.related-branch-info
%strong
%strong
=
link_to
namespace_project_compare_path
(
@project
.
namespace
,
@project
,
from:
@project
.
default_branch
,
to:
branch
),
class:
"label-branch"
do
=
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 @@
...
@@ -13,7 +13,7 @@
-
if
merge_request
.
ci_commit
-
if
merge_request
.
ci_commit
%li
%li
=
render_
ci
_status
(
merge_request
.
ci_commit
)
=
render_
pipeline
_status
(
merge_request
.
ci_commit
)
-
if
merge_request
.
open?
&&
merge_request
.
broken?
-
if
merge_request
.
open?
&&
merge_request
.
broken?
%li
%li
...
...
app/views/shared/projects/_project.html.haml
View file @
c351b9f5
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
=
project
.
main_language
=
project
.
main_language
-
if
project
.
commit
.
try
(
:status
)
-
if
project
.
commit
.
try
(
:status
)
%span
%span
=
render_c
i
_status
(
project
.
commit
)
=
render_c
ommit
_status
(
project
.
commit
)
-
if
forks
-
if
forks
%span
%span
=
icon
(
'code-fork'
)
=
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