diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-19 01:40:44 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-19 01:40:44 +0200 |
commit | 4daffbe4064e0f39e401c962bb0c0f2d8a092810 (patch) | |
tree | 88dfec9a7f2f8346e1957273543a0f7f44104512 /app/helpers/ci | |
parent | 34da6f00f6a1513703232bd071237c1ed402b6d1 (diff) | |
download | gitlab-ce-4daffbe4064e0f39e401c962bb0c0f2d8a092810.tar.gz |
Cleanup GitLab CI UIci-build-list
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers/ci')
-rw-r--r-- | app/helpers/ci/application_helper.rb | 22 | ||||
-rw-r--r-- | app/helpers/ci/builds_helper.rb | 22 | ||||
-rw-r--r-- | app/helpers/ci/commits_helper.rb | 15 |
3 files changed, 22 insertions, 37 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 diff --git a/app/helpers/ci/builds_helper.rb b/app/helpers/ci/builds_helper.rb index 422994f5984..5d6e785d951 100644 --- a/app/helpers/ci/builds_helper.rb +++ b/app/helpers/ci/builds_helper.rb @@ -15,27 +15,5 @@ module Ci def build_url(build) ci_project_build_url(build.project, build) end - - def build_status_css_class(build) - if build.success? - 'build-success' - elsif build.failed? - 'build-danger' - elsif build.canceled? - 'build-disabled' - else - 'build-warning' - end - end - - def build_icon_css_class(build) - if build.success? - 'fa-circle cgreen' - elsif build.failed? - 'fa-circle cred' - else - 'fa-circle light' - end - end end end diff --git a/app/helpers/ci/commits_helper.rb b/app/helpers/ci/commits_helper.rb index 2c86bbffa36..9069aed5b4d 100644 --- a/app/helpers/ci/commits_helper.rb +++ b/app/helpers/ci/commits_helper.rb @@ -1,20 +1,5 @@ module Ci module CommitsHelper - def commit_status_css_class(commit) - return 'build-info' unless commit - - case commit.status - when 'success' - 'build-success' - when 'failed', 'canceled' - 'build-danger' - when 'skipped' - 'build-disabled' - else - 'build-warning' - end - end - def ci_commit_path(commit) ci_project_ref_commits_path(commit.project, commit.ref, commit.sha) end |