From 1027f0408d5784244751358499e54b577b96a1a2 Mon Sep 17 00:00:00 2001 From: Maharshi Patel Date: Wed, 3 Apr 2024 11:21:37 +0530 Subject: [PATCH] fix: only render new line if value is present in dynamic content new line /
was rendering even if value was empty. which leaves empty line in the content. this commit fixes that. --- .../page/print_designer/jinja/main.html | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/print_designer/print_designer/page/print_designer/jinja/main.html b/print_designer/print_designer/page/print_designer/jinja/main.html index c1fb537..0a54666 100644 --- a/print_designer/print_designer/page/print_designer/jinja/main.html +++ b/print_designer/print_designer/page/print_designer/jinja/main.html @@ -140,26 +140,28 @@ {% macro render_spantag(field, element, row = {}, send_to_jinja = {}) -%} {% set span_value = render_spanvalue(field, element, row, send_to_jinja) %} - - {% if not field.is_static and field.is_labelled and span_value %} - - {{ _(field.label) }} - - {% endif %} - - {{ span_value }} - - {% if field.suffix and span_value %} - - {{ _(field.suffix) }} +{%- if span_value -%} + + {% if not field.is_static and field.is_labelled %} + + {{ _(field.label) }} + + {% endif %} + + {{ span_value }} + + {% if field.suffix %} + + {{ _(field.suffix) }} + + {% endif %} + {% if field.nextLine %} +
+ {% endif %}
- {% endif %} - {% if field.nextLine %} -
- {% endif %} -
+{% endif %} {%- endmacro %} {% macro render_element(element, send_to_jinja) -%} {% if element is iterable and (element is not string and element is not mapping) %}