Merge pull request #12489 from resilient-tech/fix-print-col-width

fix: respect % width while building print formats
This commit is contained in:
mergify[bot] 2021-02-25 13:04:32 +00:00 committed by GitHub
commit 9948f9e9c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,7 +165,12 @@ data-fieldname="{{ df.fieldname }}" data-fieldtype="{{ df.fieldtype }}"
{%- endmacro %}
{% macro get_width(df) -%}
{%- if df.print_width -%}{{ (df.print_width|str).replace("px", "") }}px
{%- if df.print_width -%}
{%- if df.print_width.endswith("%") -%}
{{ df.print_width }}
{%- else -%}
{{ df.print_width.replace("px", "") }}px
{%- endif -%}
{%- elif df.fieldtype in ("Int", "Check", "Float", "Currency") -%}{{ 80 }}px
{%- else -%}{{ 150 }}px{% endif -%}
{%- endmacro %}