summaryrefslogtreecommitdiff
path: root/app/views/projects/pipelines/_with_tabs.html.haml
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2017-05-04 17:50:09 +0100
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2017-05-05 15:41:36 +0100
commitacd9cd0906046f3d11d95aa9dc9d1af0498ef2ef (patch)
tree72b9ec12960971bf9412a780539956b5d1ead8d9 /app/views/projects/pipelines/_with_tabs.html.haml
parent4c0adb9ee9ee6631b7cda6562d0e20b7daab8a9e (diff)
downloadgitlab-ce-acd9cd0906046f3d11d95aa9dc9d1af0498ef2ef.tar.gz
Hides pipeline ‘Failed Jobs’ tab when no jobs have failed
Diffstat (limited to 'app/views/projects/pipelines/_with_tabs.html.haml')
-rw-r--r--app/views/projects/pipelines/_with_tabs.html.haml31
1 files changed, 17 insertions, 14 deletions
diff --git a/app/views/projects/pipelines/_with_tabs.html.haml b/app/views/projects/pipelines/_with_tabs.html.haml
index 76eb8533cc3..ba2c71cfd88 100644
--- a/app/views/projects/pipelines/_with_tabs.html.haml
+++ b/app/views/projects/pipelines/_with_tabs.html.haml
@@ -1,3 +1,5 @@
+- failed_builds = @pipeline.statuses.latest.failed
+
.tabs-holder
%ul.pipelines-tabs.nav-links.no-top.no-bottom
%li.js-pipeline-tab-link
@@ -7,10 +9,11 @@
= link_to builds_namespace_project_pipeline_path(@project.namespace, @project, @pipeline), data: {target: 'div#js-tab-builds', action: 'builds', toggle: 'tab' }, class: 'builds-tab' do
Jobs
%span.badge.js-builds-counter= pipeline.statuses.count
- %li.js-failures-tab-link
- = link_to failures_namespace_project_pipeline_path(@project.namespace, @project, @pipeline), data: {target: 'div#js-tab-failures', action: 'failures', toggle: 'tab' }, class: 'failures-tab' do
- Failures
- %span.badge.js-failures-counter= pipeline.statuses.latest.failed.count
+ - if failed_builds.present?
+ %li.js-failures-tab-link
+ = link_to failures_namespace_project_pipeline_path(@project.namespace, @project, @pipeline), data: {target: 'div#js-tab-failures', action: 'failures', toggle: 'tab' }, class: 'failures-tab' do
+ Failed Jobs
+ %span.badge.js-failures-counter= failed_builds.count
.tab-content
#js-tab-pipeline.tab-pane
@@ -41,13 +44,13 @@
%th Coverage
%th
= render partial: "projects/stage/stage", collection: pipeline.stages, as: :stage
- #js-tab-failures.build-failures.tab-pane
- - failed = @pipeline.statuses.latest.failed
- - failed.each do |build|
- .build-state
- %span.ci-status-icon-failed= custom_icon('icon_status_failed')
- %span.stage
- = build.stage.titleize
- %span.build-name
- = render "notify/links/#{build.to_partial_path}", pipeline: @pipeline, build: build
- %pre.build-log= build_summary(build)
+ - if failed_builds.present?
+ #js-tab-failures.build-failures.tab-pane
+ - failed_builds.each do |build|
+ .build-state
+ %span.ci-status-icon-failed= custom_icon('icon_status_failed')
+ %span.stage
+ = build.stage.titleize
+ %span.build-name
+ = render "notify/links/#{build.to_partial_path}", pipeline: @pipeline, build: build
+ %pre.build-log= build_summary(build)