Refactor check table to use text fields

No need to repeat the same field-calling code each time.

Think we didn’t do this before because there was no way of passing the
`status` through to the `text_field` macro.
This commit is contained in:
Chris Hill-Scott
2017-03-24 11:51:30 +00:00
parent e81b9f9b06
commit f41b95fe0c

View File

@@ -205,20 +205,14 @@
</span>
{% endcall %}
{% elif item['columns'][column].ignore %}
{% call field(status='default') %}
{{ item['columns'][column].data if item['columns'][column].data != None }}
{% endcall %}
{{ text_field(item['columns'][column].data or '', status='default') }}
{% else %}
{% call field() %}
{{ item['columns'][column].data if item['columns'][column].data != None }}
{% endcall %}
{{ text_field(item['columns'][column].data or '') }}
{% endif %}
{% endfor %}
{% if item['columns'].get(None) %}
{% for column in item['columns'][None].data %}
{% call field(status='default') %}
{{ column }}
{% endcall %}
{{ text_field(column, status='default') }}
{% endfor %}
{% endif %}
{% endcall %}