summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-06 11:05:01 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-12-06 11:08:31 +0100
commitc8b2aa8de527099cf902d5fbfd058f9dee772f24 (patch)
tree8f0d342a94528488b8bb0c48b6af1edef9dc58ce
parent40a118072d82dab27588b7907b26642e9212f969 (diff)
downloadgitlab-ce-c8b2aa8de527099cf902d5fbfd058f9dee772f24.tar.gz
Simplify ci status helper with detailed status
-rw-r--r--app/helpers/ci_status_helper.rb44
1 files changed, 22 insertions, 22 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index da0ebc0040a..29ab1404f41 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -36,30 +36,30 @@ module CiStatusHelper
end
def ci_icon_for_status(status)
+ if detailed_status?(status)
+ return custom_icon(status.icon)
+ end
+
icon_name =
- if detailed_status?(status)
- status.icon
+ case status
+ when 'success'
+ 'icon_status_success'
+ when 'success_with_warnings'
+ 'icon_status_warning'
+ when 'failed'
+ 'icon_status_failed'
+ when 'pending'
+ 'icon_status_pending'
+ when 'running'
+ 'icon_status_running'
+ when 'play'
+ 'icon_play'
+ when 'created'
+ 'icon_status_created'
+ when 'skipped'
+ 'icon_status_skipped'
else
- case status
- when 'success'
- 'icon_status_success'
- when 'success_with_warnings'
- 'icon_status_warning'
- when 'failed'
- 'icon_status_failed'
- when 'pending'
- 'icon_status_pending'
- when 'running'
- 'icon_status_running'
- when 'play'
- 'icon_play'
- when 'created'
- 'icon_status_created'
- when 'skipped'
- 'icon_status_skipped'
- else
- 'icon_status_canceled'
- end
+ 'icon_status_canceled'
end
custom_icon(icon_name)