diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-25 18:42:46 -0700 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-25 18:42:46 -0700 |
commit | 046b28312704f3131e72dcd2dbdacc5264d4aa62 (patch) | |
tree | a8c2b14a6e1db3b662fee2c79af70d9fcb643c2e /app/helpers/ci/builds_helper.rb | |
parent | e449426a4e7d15cdd582d4f136add52cbfb5e04e (diff) | |
download | gitlab-ce-046b28312704f3131e72dcd2dbdacc5264d4aa62.tar.gz |
Groundwork for merging CI into CE
Diffstat (limited to 'app/helpers/ci/builds_helper.rb')
-rw-r--r-- | app/helpers/ci/builds_helper.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/app/helpers/ci/builds_helper.rb b/app/helpers/ci/builds_helper.rb new file mode 100644 index 00000000000..cdabdad17d2 --- /dev/null +++ b/app/helpers/ci/builds_helper.rb @@ -0,0 +1,41 @@ +module Ci + module BuildsHelper + def build_ref_link build + gitlab_ref_link build.project, build.ref + end + + def build_compare_link build + gitlab_compare_link build.project, build.commit.short_before_sha, build.short_sha + end + + def build_commit_link build + gitlab_commit_link build.project, build.short_sha + end + + def build_url(build) + ci_project_build_url(build.project, build) + end + + def build_status_alert_class(build) + if build.success? + 'alert-success' + elsif build.failed? + 'alert-danger' + elsif build.canceled? + 'alert-disabled' + else + 'alert-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 |