Commit 086da921 authored by Mike Greiling's avatar Mike Greiling

fetch local parameters in _generic_commit_status.html.haml similar to how...

fetch local parameters in _generic_commit_status.html.haml similar to how _build.html.haml handles them
parent ef6a91af
- 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 %tr.generic_commit_status
%td.status %td.status
- if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url - if can?(current_user, :read_commit_status, generic_commit_status) && generic_commit_status.target_url
...@@ -12,10 +20,10 @@ ...@@ -12,10 +20,10 @@
- else - else
%strong ##{generic_commit_status.id} %strong ##{generic_commit_status.id}
- if defined?(retried) && retried - if retried
= icon('warning', class: 'text-warning has-tooltip', title: 'Status was retried.') = icon('warning', class: 'text-warning has-tooltip', title: 'Status was retried.')
- if defined?(pipeline_link) && pipeline_link - if pipeline_link
%td %td
= link_to pipeline_path(generic_commit_status.pipeline) do = link_to pipeline_path(generic_commit_status.pipeline) do
%span.pipeline-id ##{generic_commit_status.pipeline.id} %span.pipeline-id ##{generic_commit_status.pipeline.id}
...@@ -25,25 +33,25 @@ ...@@ -25,25 +33,25 @@
- else - else
%span.monospace API %span.monospace API
- if defined?(commit_sha) && commit_sha - if commit_sha
%td %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" = 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 %td
- if generic_commit_status.ref - 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) = link_to generic_commit_status.ref, namespace_project_commits_path(generic_commit_status.project.namespace, generic_commit_status.project, generic_commit_status.ref)
- else - else
.light none .light none
- if defined?(runner) && runner - if runner
%td %td
- if generic_commit_status.try(:runner) - if generic_commit_status.try(:runner)
= runner_link(generic_commit_status.runner) = runner_link(generic_commit_status.runner)
- else - else
.light none .light none
- if defined?(stage) && stage - if stage
%td %td
= generic_commit_status.stage = generic_commit_status.stage
...@@ -55,7 +63,7 @@ ...@@ -55,7 +63,7 @@
- generic_commit_status.tags.each do |tag| - generic_commit_status.tags.each do |tag|
%span.label.label-primary %span.label.label-primary
= tag = tag
- if defined?(retried) && retried - if retried
%span.label.label-warning retried %span.label.label-warning retried
%td.duration %td.duration
...@@ -68,7 +76,7 @@ ...@@ -68,7 +76,7 @@
= icon("calendar") = icon("calendar")
%span #{time_ago_with_tooltip(generic_commit_status.finished_at)} %span #{time_ago_with_tooltip(generic_commit_status.finished_at)}
- if defined?(coverage) && coverage - if coverage
%td.coverage %td.coverage
- if generic_commit_status.try(:coverage) - if generic_commit_status.try(:coverage)
#{generic_commit_status.coverage}% #{generic_commit_status.coverage}%
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment