From c9f1809df9930144801f7566a8396735950a675a Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Fri, 21 Jul 2017 11:45:39 +0200 Subject: [PATCH] Only show Report html-field is field is not blank --- ...single_public_report_without_comments.html | 3 +- .../submissions/_single_report_content.html | 47 +++++++++++-------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/submissions/templates/submissions/_single_public_report_without_comments.html b/submissions/templates/submissions/_single_public_report_without_comments.html index bad492424..f39932745 100644 --- a/submissions/templates/submissions/_single_public_report_without_comments.html +++ b/submissions/templates/submissions/_single_public_report_without_comments.html @@ -28,9 +28,10 @@ <div class="row"> <div class="col-12"> <h3>Remarks for editors</h3> - <div class="pl-md-4">{{ report.remarks_for_editors }}</div> + <div class="pl-md-4">{{ report.remarks_for_editors|default:'-' }}</div> </div> </div> + <div class="row"> <div class="col-12"> <h3>Recommendation</h3> diff --git a/submissions/templates/submissions/_single_report_content.html b/submissions/templates/submissions/_single_report_content.html index 82e06f943..3e1874d8a 100644 --- a/submissions/templates/submissions/_single_report_content.html +++ b/submissions/templates/submissions/_single_report_content.html @@ -1,27 +1,36 @@ -<div class="row"> - <div class="col-12"> - <h3 class="highlight tight">Strengths</h3> - <div class="pl-md-4">{{ report.strengths|linebreaks }}</div> +{% if report.strengths %} + <div class="row"> + <div class="col-12"> + <h3 class="highlight tight">Strengths</h3> + <div class="pl-md-4">{{ report.strengths|linebreaks }}</div> + </div> </div> -</div> -<div class="row"> - <div class="col-12"> - <h3 class="highlight tight">Weaknesses</h3> - <div class="pl-md-4">{{ report.weaknesses|linebreaks }}</div> +{% endif %} + +{% if report.weaknesses %} + <div class="row"> + <div class="col-12"> + <h3 class="highlight tight">Weaknesses</h3> + <div class="pl-md-4">{{ report.weaknesses|linebreaks }}</div> + </div> </div> -</div> +{% endif %} + <div class="row"> <div class="col-12"> <h3 class="highlight tight">Report</h3> <div class="pl-md-4">{{ report.report|linebreaks }}</div> </div> </div> -<div class="row"> - <div class="col-12"> - <h3 class="highlight tight">Requested changes</h3> - <div class="pl-md-4"> - <p>{{ report.requested_changes|linebreaks }}</p> - {% include 'submissions/_single_report_ratings.html' with report=report %} - </div> - </div> -</div> + +{% if report.requested_changes %} + <div class="row"> + <div class="col-12"> + <h3 class="highlight tight">Requested changes</h3> + <div class="pl-md-4"> + <p>{{ report.requested_changes|linebreaksbr }}</p> + {% include 'submissions/_single_report_ratings.html' with report=report %} + </div> + </div> + </div> +{% endif %} -- GitLab