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
Léo-Paul Géneau
gitlab-ce
Commits
bdc13c31
Commit
bdc13c31
authored
Dec 06, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Untangle status label and text in ci status helper
parent
c8b2aa8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+10
-2
lib/gitlab/ci/status/core.rb
lib/gitlab/ci/status/core.rb
+11
-0
No files found.
app/helpers/ci_status_helper.rb
View file @
bdc13c31
...
@@ -5,8 +5,8 @@ module CiStatusHelper
...
@@ -5,8 +5,8 @@ module CiStatusHelper
end
end
def
ci_status_with_icon
(
status
,
target
=
nil
)
def
ci_status_with_icon
(
status
,
target
=
nil
)
content
=
ci_icon_for_status
(
status
)
+
ci_
label
_for_status
(
status
)
content
=
ci_icon_for_status
(
status
)
+
ci_
text
_for_status
(
status
)
klass
=
"ci-status ci-
#{
status
}
"
# TODO, add support for detailed status
klass
=
"ci-status ci-
#{
status
}
"
if
target
if
target
link_to
content
,
target
,
class:
klass
link_to
content
,
target
,
class:
klass
...
@@ -15,6 +15,14 @@ module CiStatusHelper
...
@@ -15,6 +15,14 @@ module CiStatusHelper
end
end
end
end
def
ci_text_for_status
(
status
)
if
detailed_status?
(
status
)
status
.
text
else
status
end
end
def
ci_label_for_status
(
status
)
def
ci_label_for_status
(
status
)
if
detailed_status?
(
status
)
if
detailed_status?
(
status
)
return
status
.
label
return
status
.
label
...
...
lib/gitlab/ci/status/core.rb
View file @
bdc13c31
...
@@ -22,6 +22,17 @@ module Gitlab
...
@@ -22,6 +22,17 @@ module Gitlab
"
#{
@subject
.
class
.
name
.
demodulize
}
:
#{
label
}
"
"
#{
@subject
.
class
.
name
.
demodulize
}
:
#{
label
}
"
end
end
# Deprecation warning: this method is here because we need to maintain
# backwards compatibility with legacy statuses. We often do something
# like "ci-status ci-status-#{status}" to set CSS class.
#
# `to_s` method should be renamed to `group` at some point, after
# phasing legacy satuses out.
#
def
to_s
self
.
class
.
name
.
demodulize
.
downcase
end
def
has_details?
def
has_details?
raise
NotImplementedError
raise
NotImplementedError
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