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
664384e7
Unverified
Commit
664384e7
authored
Dec 16, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/rs-simplify-status-icon'
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parents
3321f694
3084c8c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
26 deletions
+24
-26
status.scss
app/assets/stylesheets/pages/status.scss
+17
-0
ci_status_helper.rb
app/helpers/ci_status_helper.rb
+4
-18
ci_status_helper_spec.rb
spec/helpers/ci_status_helper_spec.rb
+3
-8
No files found.
app/assets/stylesheets/pages/status.scss
View file @
664384e7
...
...
@@ -35,3 +35,20 @@
border-color
:
$gl-warning
;
}
}
.ci-status-icon-success
{
@extend
.cgreen
;
}
.ci-status-icon-failed
{
@extend
.cred
;
}
.ci-status-icon-running
,
.ci-status-icon-pending
{
// These are standard text color
}
.ci-status-icon-canceled
,
.ci-status-icon-disabled
,
.ci-status-icon-not-found
,
.ci-status-icon-skipped
{
@extend
.cgray
;
}
app/helpers/ci_status_helper.rb
View file @
664384e7
...
...
@@ -12,19 +12,6 @@ module CiStatusHelper
ci_label_for_status
(
ci_commit
.
status
)
end
def
ci_status_color
(
ci_commit
)
case
ci_commit
.
status
when
'success'
'green'
when
'failed'
'red'
when
'running'
,
'pending'
'yellow'
else
'gray'
end
end
def
ci_status_with_icon
(
status
)
content_tag
:span
,
class:
"ci-status ci-
#{
status
}
"
do
ci_icon_for_status
(
status
)
+
' '
.
html_safe
+
ci_label_for_status
(
status
)
...
...
@@ -56,12 +43,11 @@ module CiStatusHelper
end
def
render_ci_status
(
ci_commit
)
link_to
ci_status_path
(
ci_commit
),
class:
"ci-status-link c
#{
ci_status_color
(
ci_commit
)
}
"
,
link_to
ci_status_icon
(
ci_commit
),
ci_status_path
(
ci_commit
),
class:
"ci-status-link ci-status-icon-
#{
ci_commit
.
status
.
dasherize
}
"
,
title:
"Build
#{
ci_status_label
(
ci_commit
)
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
'left'
}
do
ci_status_icon
(
ci_commit
)
end
data:
{
toggle:
'tooltip'
,
placement:
'left'
}
end
def
no_runners_for_project?
(
project
)
...
...
spec/helpers/ci_status_helper_spec.rb
View file @
664384e7
...
...
@@ -6,13 +6,8 @@ describe CiStatusHelper do
let
(
:success_commit
)
{
double
(
"Ci::Commit"
,
status:
'success'
)
}
let
(
:failed_commit
)
{
double
(
"Ci::Commit"
,
status:
'failed'
)
}
describe
'ci_status_color'
do
it
{
expect
(
ci_status_icon
(
success_commit
)).
to
include
(
'fa-check'
)
}
it
{
expect
(
ci_status_icon
(
failed_commit
)).
to
include
(
'fa-close'
)
}
end
describe
'ci_status_color'
do
it
{
expect
(
ci_status_color
(
success_commit
)).
to
eq
(
'green'
)
}
it
{
expect
(
ci_status_color
(
failed_commit
)).
to
eq
(
'red'
)
}
describe
'ci_status_icon'
do
it
{
expect
(
helper
.
ci_status_icon
(
success_commit
)).
to
include
(
'fa-check'
)
}
it
{
expect
(
helper
.
ci_status_icon
(
failed_commit
)).
to
include
(
'fa-close'
)
}
end
end
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