summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-10-21 16:22:43 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-10-24 22:26:06 +0800
commit5416d0e0837f69f35a3a9deaf947fd62e5293661 (patch)
tree464b29e773327e213a035131ee0f8f2c770f0fd7 /app/helpers
parent4028022f56f81f9cbe1227dae53c878f702bd8fa (diff)
downloadgitlab-ce-5416d0e0837f69f35a3a9deaf947fd62e5293661.tar.gz
Pass `@ref` along so we know which pipeline to show
Closes #23615
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/ci_status_helper.rb5
-rw-r--r--app/helpers/commits_helper.rb8
2 files changed, 10 insertions, 3 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb
index b7f48630bd4..7d1b41b8fbe 100644
--- a/app/helpers/ci_status_helper.rb
+++ b/app/helpers/ci_status_helper.rb
@@ -54,6 +54,11 @@ module CiStatusHelper
custom_icon(icon_name)
end
+ def render_commit_ref_status(commit, ref = nil, **args)
+ pipeline = commit.pipelines_for(ref).last
+ render_pipeline_status(pipeline, **args)
+ end
+
def render_commit_status(commit, tooltip_placement: 'auto left')
project = commit.project
path = pipelines_namespace_project_commit_path(project.namespace, project, commit)
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 33dcee49aee..ed402b698fb 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -25,9 +25,11 @@ module CommitsHelper
end
end
- def commit_to_html(commit, project, inline = true)
- template = inline ? "inline_commit" : "commit"
- render "projects/commits/#{template}", commit: commit, project: project unless commit.nil?
+ def commit_to_html(commit, ref, project)
+ render 'projects/commits/commit',
+ commit: commit,
+ ref: ref,
+ project: project
end
# Breadcrumb links for a Project and, if applicable, a tree path