summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-09-23 11:41:24 +0000
committerDouwe Maan <douwe@gitlab.com>2015-09-23 11:41:24 +0000
commite63b64de34a8f00fe1b77afe79dc240cdd654806 (patch)
treeba29f91edfdfcb48e6ffab42fe3ed815362d1a3e /app/helpers
parent486a6479258c993ec1690d20acd0983ee102b967 (diff)
parent3b6915d8910296296676e32129138c50bb1b0c5c (diff)
downloadgitlab-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 ![Screenshot_2015-09-23_12.34.50](https://gitlab.com/gitlab-org/gitlab-ce/uploads/d40d6a69f76128e32d3a0cb641b3495b/Screenshot_2015-09-23_12.34.50.png) Fixes #2632 See merge request !1402
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/ci_status_helper.rb34
-rw-r--r--app/helpers/commits_helper.rb2
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)