From f41b95fe0ce7a4b139c65be494ba92e1d9dc0d6f Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 24 Mar 2017 11:51:30 +0000 Subject: [PATCH] Refactor check table to use text fields MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- app/templates/views/check.html | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/templates/views/check.html b/app/templates/views/check.html index 7d7de30b6..fda5f23c0 100644 --- a/app/templates/views/check.html +++ b/app/templates/views/check.html @@ -205,20 +205,14 @@ {% 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 %}