summaryrefslogtreecommitdiff
path: root/app/helpers/ci/application_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/ci/application_helper.rb')
-rw-r--r--app/helpers/ci/application_helper.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/helpers/ci/application_helper.rb b/app/helpers/ci/application_helper.rb
index 7e880b00b3a..9fe6282bb81 100644
--- a/app/helpers/ci/application_helper.rb
+++ b/app/helpers/ci/application_helper.rb
@@ -28,5 +28,27 @@ module Ci
"#{pluralize(seconds, "second")}"
end
end
+
+ def ci_icon_for_status(status)
+ icon_name =
+ case status
+ when 'success'
+ 'check-square'
+ when 'failed'
+ 'close'
+ when 'running', 'pending'
+ 'clock-o'
+ else
+ 'circle'
+ end
+
+ icon(icon_name)
+ end
+
+ def ci_status_with_icon(status)
+ content_tag :span, class: "ci-status ci-#{status}" do
+ ci_icon_for_status(status) + ' '.html_safe + status
+ end
+ end
end
end