Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only render new line if value is present (develop) #212

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,26 @@
<!-- third Arg is row which is not sent outside table -->
{% macro span_tag(field, element, row = {}, send_to_jinja = {}) -%}
{% set span_value = spanvalue(field, element, row, send_to_jinja) %}
<span class="{% if not field.is_static and field.is_labelled %}baseSpanTag{% endif %}">
{% if not field.is_static and field.is_labelled and span_value %}
<span class="{% if row %}printTable{% else %}dynamicText{% endif %} label-text labelSpanTag" style="user-select:auto; {%if element.labelStyle %}{{convert_css(element.labelStyle)}}{%endif%}{%if field.labelStyle %}{{convert_css(field.labelStyle)}}{%endif%} white-space:nowrap; ">
{{ _(field.label) }}
</span>
{% endif %}
{%- if span_value -%}
<span class="{% if not field.is_static and field.is_labelled %}baseSpanTag{% endif %}">
{% if not field.is_static and field.is_labelled%}
<span class="{% if row %}printTable{% else %}dynamicText{% endif %} label-text labelSpanTag" style="user-select:auto; {%if element.labelStyle %}{{convert_css(element.labelStyle)}}{%endif%}{%if field.labelStyle %}{{convert_css(field.labelStyle)}}{%endif%} white-space:nowrap; ">
{{ _(field.label) }}
</span>
{% endif %}
<span class="dynamic-span {% if not field.is_static and field.is_labelled %}valueSpanTag{%endif%} {{page_class(field)}} }}"
style="{%- if element.style.get('color') -%}{{ convert_css({'color': element.style.get('color')})}}{%- endif -%} {{convert_css(field.style)}} user-select:auto;">
{{ span_value }}
</span>
{% if field.nextLine %}
<br/>
{% endif %}
</span>
{% if field.suffix %}
<span class="dynamic-span"
style="{%- if element.style.get('color') -%}{{ convert_css({'color': element.style.get('color')})}}{%- endif -%} {{convert_css(field.style)}} user-select:auto;">
{{ _(field.suffix) }}
</span>
{% endif %}
{% if field.nextLine %}
<br/>
{% endif %}
</span>
{% endif %}
{%- endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,28 @@
<!-- third Arg is row which is not sent outside table -->
{% macro render_spantag(field, element, row = {}, send_to_jinja = {}) -%}
{% set span_value = render_spanvalue(field, element, row, send_to_jinja) %}
<span class="{% if not field.is_static and field.is_labelled %}baseSpanTag{% endif %}">
{% if not field.is_static and field.is_labelled and span_value %}
<span class="{% if row %}printTable{% else %}dynamicText{% endif %} label-text labelSpanTag" style="user-select:auto; {%if element.labelStyle %}{{convert_css(element.labelStyle)}}{%endif%}{%if field.labelStyle %}{{convert_css(field.labelStyle)}}{%endif%} white-space:nowrap; ">
{{ _(field.label) }}
</span>
{% endif %}
<span class="dynamic-span {% if not field.is_static and field.is_labelled %}valueSpanTag{%endif%} {{page_class(field)}} }}"
style="{%- if element.style.get('color') -%}{{ convert_css({'color': element.style.get('color')})}}{%- endif -%} {{convert_css(field.style)}} user-select:auto;">
{{ span_value }}
</span>
{% if field.suffix and span_value %}
<span class="dynamic-span"
style="{%- if element.style.get('color') -%}{{ convert_css({'color': element.style.get('color')})}}{%- endif -%} {{convert_css(field.style)}} user-select:auto;">
{{ _(field.suffix) }}
{%- if span_value -%}
<span class="{% if not field.is_static and field.is_labelled %}baseSpanTag{% endif %}">
{% if not field.is_static and field.is_labelled %}
<span class="{% if row %}printTable{% else %}dynamicText{% endif %} label-text labelSpanTag" style="user-select:auto; {%if element.labelStyle %}{{convert_css(element.labelStyle)}}{%endif%}{%if field.labelStyle %}{{convert_css(field.labelStyle)}}{%endif%} white-space:nowrap; ">
{{ _(field.label) }}
</span>
{% endif %}
<span class="dynamic-span {% if not field.is_static and field.is_labelled %}valueSpanTag{%endif%} {{page_class(field)}} }}"
style="{%- if element.style.get('color') -%}{{ convert_css({'color': element.style.get('color')})}}{%- endif -%} {{convert_css(field.style)}} user-select:auto;">
{{ span_value }}
</span>
{% if field.suffix %}
<span class="dynamic-span"
style="{%- if element.style.get('color') -%}{{ convert_css({'color': element.style.get('color')})}}{%- endif -%} {{convert_css(field.style)}} user-select:auto;">
{{ _(field.suffix) }}
</span>
{% endif %}
{% if field.nextLine %}
<br/>
{% endif %}
</span>
{% endif %}
{% if field.nextLine %}
<br/>
{% endif %}
</span>
{% endif %}
{%- endmacro %}
{% macro render_element(element, send_to_jinja) -%}
{% if element is iterable and (element is not string and element is not mapping) %}
Expand Down
Loading