Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-06 13:22:31 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-06 13:22:31 +0300
commitbdc13c3142507650e9170cc7b9b63232bb1cfdad (patch)
treed369e661d08d18460145aa2397a98494a77e6107 /app/helpers/ci_status_helper.rb
parentc8b2aa8de527099cf902d5fbfd058f9dee772f24 (diff)
Untangle status label and text in ci status helper
Diffstat (limited to 'app/helpers/ci_status_helper.rb')
-rw-r--r--app/helpers/ci_status_helper.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index 29ab1404f41..8e19752a8a1 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -5,8 +5,8 @@ module CiStatusHelper
end
def ci_status_with_icon(status, target = nil)
- content = ci_icon_for_status(status) + ci_label_for_status(status)
- klass = "ci-status ci-#{status}" # TODO, add support for detailed status
+ content = ci_icon_for_status(status) + ci_text_for_status(status)
+ klass = "ci-status ci-#{status}"
if target
link_to content, target, class: klass
@@ -15,6 +15,14 @@ module CiStatusHelper
end
end
+ def ci_text_for_status(status)
+ if detailed_status?(status)
+ status.text
+ else
+ status
+ end
+ end
+
def ci_label_for_status(status)
if detailed_status?(status)
return status.label