From b7deda9405e3c7355bd470b4288b636e95bcb5b2 Mon Sep 17 00:00:00 2001 From: Mike Greiling <mike@pixelcog.com> Date: Mon, 28 Nov 2016 21:08:29 -0600 Subject: [PATCH] collapse nested if statement --- app/views/projects/ci/builds/_build.html.haml | 5 ++--- .../generic_commit_statuses/_generic_commit_status.html.haml | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml index 33b4e9329a2..e75547c815f 100644 --- a/app/views/projects/ci/builds/_build.html.haml +++ b/app/views/projects/ci/builds/_build.html.haml @@ -91,9 +91,8 @@ %span #{time_ago_with_tooltip(build.finished_at)} %td.coverage - - if coverage - - if build.try(:coverage) - #{build.coverage}% + - if coverage && build.try(:coverage) + #{build.coverage}% %td .pull-right 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 131883b8106..7f751d9ae2e 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 @@ -83,9 +83,8 @@ %span #{time_ago_with_tooltip(generic_commit_status.finished_at)} %td.coverage - - if coverage - - if generic_commit_status.try(:coverage) - #{generic_commit_status.coverage}% + - if coverage && generic_commit_status.try(:coverage) + #{generic_commit_status.coverage}% %td -# empty column to match number of columns in ci/builds/_build.html.haml -- GitLab