summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-11-28 20:15:18 -0600
committerMike Greiling <mike@pixelcog.com>2016-11-29 12:55:07 -0600
commit086da9214d2bde1f652f197b0e130f60eef12c2e (patch)
treebb52e5cc06477e9d2fdf3aff8672835e63b6014d
parentef6a91af123d8b773ba8a286cf986abaedee6c33 (diff)
downloadgitlab-ce-086da9214d2bde1f652f197b0e130f60eef12c2e.tar.gz
fetch local parameters in _generic_commit_status.html.haml similar to how _build.html.haml handles them
-rw-r--r--app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml24
1 files changed, 16 insertions, 8 deletions
diff --git a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
index 0b99e9f8756..ceaab8c7d45 100644
--- a/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
+++ b/app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml
@@ -1,3 +1,11 @@
+- ref = local_assigns.fetch(:ref, nil)
+- commit_sha = local_assigns.fetch(:commit_sha, nil)
+- retried = local_assigns.fetch(:retried, false)
+- pipeline_link = local_assigns.fetch(:pipeline_link, false)
+- stage = local_assigns.fetch(:stage, false)
+- coverage = local_assigns.fetch(:coverage, false)
+- runner = local_assigns.fetch(:runner, false)
+
%tr.generic_commit_status
%td.status
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
@@ -12,10 +20,10 @@
- else
%strong ##{generic_commit_status.id}
- - if defined?(retried) && retried
+ - if retried
= icon('warning', class: 'text-warning has-tooltip', title: 'Status was retried.')
- - if defined?(pipeline_link) && pipeline_link
+ - if pipeline_link
%td
= link_to pipeline_path(generic_commit_status.pipeline) do
%span.pipeline-id ##{generic_commit_status.pipeline.id}
@@ -25,25 +33,25 @@
- else
%span.monospace API
- - if defined?(commit_sha) && commit_sha
+ - if commit_sha
%td
= link_to generic_commit_status.short_sha, namespace_project_commit_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.sha), class: "monospace"
- - if defined?(ref) && ref
+ - if ref
%td
- if generic_commit_status.ref
= link_to generic_commit_status.ref, namespace_project_commits_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.ref)
- else
.light none
- - if defined?(runner) && runner
+ - if runner
%td
- if generic_commit_status.try(:runner)
= runner_link(generic_commit_status.runner)
- else
.light none
- - if defined?(stage) && stage
+ - if stage
%td
= generic_commit_status.stage
@@ -55,7 +63,7 @@
- generic_commit_status.tags.each do |tag|
%span.label.label-primary
= tag
- - if defined?(retried) && retried
+ - if retried
%span.label.label-warning retried
%td.duration
@@ -68,7 +76,7 @@
= icon("calendar")
%span #{time_ago_with_tooltip(generic_commit_status.finished_at)}
- - if defined?(coverage) && coverage
+ - if coverage
%td.coverage
- if generic_commit_status.try(:coverage)
#{generic_commit_status.coverage}%