From 0437e4a2483356f2d9d573802e782c1a3ec66c6c Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Wed, 6 Apr 2022 18:14:43 +0100 Subject: [PATCH] Standardise appearance of missing data This makes the rendering the same as for "created_by_name" when the data isn't present. It's a bit more complicated for "updated_at" so I checked that it's implicitly covered by the tests, which fail if I remove the "if" conditional for any of these fields. --- app/templates/views/providers/providers.html | 27 +++++++++----------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/app/templates/views/providers/providers.html b/app/templates/views/providers/providers.html index 0b9bd190e..37efad72b 100644 --- a/app/templates/views/providers/providers.html +++ b/app/templates/views/providers/providers.html @@ -31,11 +31,10 @@ Providers {{ text_field(item.active) }} - {% if item.updated_at %} - {{ text_field(item.updated_at|format_datetime_short) }} - {% else %} - {{ text_field('None') }} - {% endif %} + {{ optional_text_field( + item.updated_at|format_datetime_short if item.updated_at, + default='None' + ) }} {{ optional_text_field(item.created_by_name, default='None') }} @@ -56,11 +55,10 @@ Providers {{ text_field(item.active) }} - {% if item.updated_at %} - {{ text_field(item.updated_at|format_datetime_short) }} - {% else %} - {{ text_field('None') }} - {% endif %} + {{ optional_text_field( + item.updated_at|format_datetime_short if item.updated_at, + default='None' + ) }} {{ optional_text_field(item.created_by_name, default='None') }} {% endcall %} @@ -80,11 +78,10 @@ Providers {{ text_field(item.active) }} - {% if item.updated_at %} - {{ text_field(item.updated_at|format_datetime_short) }} - {% else %} - {{ text_field('None') }} - {% endif %} + {{ optional_text_field( + item.updated_at|format_datetime_short if item.updated_at, + default='None' + ) }} {{ optional_text_field(item.created_by_name, default='None') }}