diff options
| author | Douwe Maan <douwe@gitlab.com> | 2015-09-23 11:41:24 +0000 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2015-09-23 11:41:24 +0000 |
| commit | e63b64de34a8f00fe1b77afe79dc240cdd654806 (patch) | |
| tree | ba29f91edfdfcb48e6ffab42fe3ed815362d1a3e /app/helpers | |
| parent | 486a6479258c993ec1690d20acd0983ee102b967 (diff) | |
| parent | 3b6915d8910296296676e32129138c50bb1b0c5c (diff) | |
| download | gitlab-ce-e63b64de34a8f00fe1b77afe79dc240cdd654806.tar.gz | |
Merge branch 'commits-page-ci-status' into 'master'
Commits page CI status
Show CI status for each commit row on pages like: Commits, Merge request (commits tab), Compare etc

Fixes #2632
See merge request !1402
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/ci_status_helper.rb | 34 | ||||
| -rw-r--r-- | app/helpers/commits_helper.rb | 2 |
2 files changed, 35 insertions, 1 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb new file mode 100644 index 00000000000..18c30ddb281 --- /dev/null +++ b/app/helpers/ci_status_helper.rb @@ -0,0 +1,34 @@ +module CiStatusHelper + def ci_status_path(ci_commit) + ci_project_ref_commits_path(ci_commit.project, ci_commit.ref, ci_commit) + end + + def ci_status_icon(ci_commit) + icon_name = + case ci_commit.status + when 'success' + 'check' + when 'failed' + 'close' + when 'running', 'pending' + 'clock-o' + else + 'circle' + end + + icon(icon_name) + 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 +end diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index d13d80be293..9df20c9fce5 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -135,7 +135,7 @@ module CommitsHelper # size: size of the avatar image in px def commit_person_link(commit, options = {}) user = commit.send(options[:source]) - + source_name = clean(commit.send "#{options[:source]}_name".to_sym) source_email = clean(commit.send "#{options[:source]}_email".to_sym) |
