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:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-29 17:26:40 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-09-29 17:26:40 +0300
commit3d9a7cdb4be6d6d059dfd7ccc8fa2e4bd3ab12e3 (patch)
treefbc4fb4a8ae361436e92c794c01ebab2c83c4e18 /app/helpers/ci_status_helper.rb
parent87240e989ba913bad787d8bc81da1a9b87f1da53 (diff)
Refactor CI helpers
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/ci_status_helper.rb')
-rw-r--r--app/helpers/ci_status_helper.rb36
1 files changed, 23 insertions, 13 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index 18c30ddb281..3a88ed7107e 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -4,19 +4,7 @@ module CiStatusHelper
end
def ci_status_icon(ci_commit)
- icon_name =
- case ci_commit.status
- when 'success'
- 'check'
- when 'failed'
- 'close'
- when 'running', 'pending'
- 'clock-o'
- else
- 'circle'
- end
-
- icon(icon_name)
+ ci_icon_for_status(ci_commit.status)
end
def ci_status_color(ci_commit)
@@ -31,4 +19,26 @@ module CiStatusHelper
'gray'
end
end
+
+ def ci_status_with_icon(status)
+ content_tag :span, class: "ci-status ci-#{status}" do
+ ci_icon_for_status(status) + '&nbsp;'.html_safe + status
+ end
+ end
+
+ def ci_icon_for_status(status)
+ icon_name =
+ case status
+ when 'success'
+ 'check'
+ when 'failed'
+ 'close'
+ when 'running', 'pending'
+ 'clock-o'
+ else
+ 'circle'
+ end
+
+ icon(icon_name)
+ end
end