diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-06 11:05:01 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-12-06 11:08:31 +0100 |
commit | c8b2aa8de527099cf902d5fbfd058f9dee772f24 (patch) | |
tree | 8f0d342a94528488b8bb0c48b6af1edef9dc58ce /app/helpers/ci_status_helper.rb | |
parent | 40a118072d82dab27588b7907b26642e9212f969 (diff) | |
download | gitlab-ce-c8b2aa8de527099cf902d5fbfd058f9dee772f24.tar.gz |
Simplify ci status helper with detailed status
Diffstat (limited to 'app/helpers/ci_status_helper.rb')
-rw-r--r-- | app/helpers/ci_status_helper.rb | 44 |
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) |