diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-12 21:18:51 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-12 21:18:51 +0300 |
commit | 3084c8c37064d7309ac4ca7b9ecb24ca8c625d24 (patch) | |
tree | 82ce7fcb7a8faf5e487a2247088efffdfe82237a /app/helpers/ci_status_helper.rb | |
parent | a5e449571bb941d65d33569a0f0db575a5b3d399 (diff) |
Define CI status icon colors in SCSS instead of a helper
Diffstat (limited to 'app/helpers/ci_status_helper.rb')
-rw-r--r-- | app/helpers/ci_status_helper.rb | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index f8f2cbf1319..fe5cad54a30 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -12,19 +12,6 @@ module CiStatusHelper ci_label_for_status(ci_commit.status) end - def ci_status_color(ci_commit) - case ci_commit.status - when 'success' - 'green' - when 'failed' - 'red' - when 'running', 'pending' - 'yellow' - else - 'gray' - end - end - def ci_status_with_icon(status) content_tag :span, class: "ci-status ci-#{status}" do ci_icon_for_status(status) + ' '.html_safe + ci_label_for_status(status) @@ -56,11 +43,10 @@ module CiStatusHelper end def render_ci_status(ci_commit) - link_to ci_status_path(ci_commit), - class: "c#{ci_status_color(ci_commit)}", + link_to ci_status_icon(ci_commit), + ci_status_path(ci_commit), + class: "ci-status-icon-#{ci_commit.status.dasherize}", title: "Build #{ci_status_label(ci_commit)}", - data: { toggle: 'tooltip', placement: 'left' } do - ci_status_icon(ci_commit) - end + data: { toggle: 'tooltip', placement: 'left' } end end |