diff options
-rw-r--r-- | app/views/projects/generic_commit_statuses/_generic_commit_status.html.haml | 24 |
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}% |