diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-08-18 09:21:40 -0600 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-08-18 09:21:40 -0600 |
commit | b5d0346a99401ec138ee411660b5c7ee28421f84 (patch) | |
tree | da373c601bc635e5293876b659f587c87d09848f /app/helpers | |
parent | c64e977d2e36caf108a1b8dd7348b2846e06b7f0 (diff) | |
parent | ac73de508e21af95b473bfafc2ca2543b234430d (diff) | |
download | gitlab-ce-b5d0346a99401ec138ee411660b5c7ee28421f84.tar.gz |
Merge branch 'master' into diff-line-comment-vuejs
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/ci_status_helper.rb | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index ea2f5f9281a..94df7d131ca 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -38,6 +38,10 @@ module CiStatusHelper 'icon_status_pending' when 'running' 'icon_status_running' + when 'play' + return icon('play fw') + when 'created' + 'icon_status_pending' else 'icon_status_cancel' end @@ -48,13 +52,13 @@ module CiStatusHelper def render_commit_status(commit, tooltip_placement: 'auto left') project = commit.project path = builds_namespace_project_commit_path(project.namespace, project, commit) - render_status_with_link('commit', commit.status, path, tooltip_placement) + render_status_with_link('commit', commit.status, path, tooltip_placement: tooltip_placement) end def render_pipeline_status(pipeline, tooltip_placement: 'auto left') project = pipeline.project path = namespace_project_pipeline_path(project.namespace, project, pipeline) - render_status_with_link('pipeline', pipeline.status, path, tooltip_placement) + render_status_with_link('pipeline', pipeline.status, path, tooltip_placement: tooltip_placement) end def no_runners_for_project?(project) @@ -62,13 +66,17 @@ module CiStatusHelper Ci::Runner.shared.blank? end - private + def render_status_with_link(type, status, path = nil, tooltip_placement: 'auto left', cssclass: '') + klass = "ci-status-link ci-status-icon-#{status.dasherize} #{cssclass}" + title = "#{type.titleize}: #{ci_label_for_status(status)}" + data = { toggle: 'tooltip', placement: tooltip_placement } - def render_status_with_link(type, status, path, tooltip_placement, cssclass: '') - link_to ci_icon_for_status(status), - path, - class: "ci-status-link ci-status-icon-#{status.dasherize} #{cssclass}", - title: "#{type.titleize}: #{ci_label_for_status(status)}", - data: { toggle: 'tooltip', placement: tooltip_placement } + if path + link_to ci_icon_for_status(status), path, + class: klass, title: title, data: data + else + content_tag :span, ci_icon_for_status(status), + class: klass, title: title, data: data + end end end |