Refactor to put yes/no/can’t tell in one place

The code is a bit easier to follow if the same output is always coming
from the same statement in the code.
This commit is contained in:
Chris Hill-Scott
2021-10-11 15:42:29 +01:00
parent 72742cf477
commit 98e9749771

View File

@@ -3,11 +3,11 @@ Service: {{ current_service.name }}
---
Organisation type: {{ current_service.organisation_type_label }}
Agreement signed:
{%- if current_service.organisation.agreement_signed %} Yes, on behalf of {{ current_service.organisation.name }}.
{%- elif current_service.organisation.name %} {{ current_service.organisation.agreement_signed|format_yes_no(none='Cant tell') }} (organisation is {{ current_service.organisation.name }}, {{ current_service.organisation.crown|format_yes_no(yes='a crown body', no='a non-crown body', none='crown status unknown') }}).
{%- else %} Cant tell (domain is {{ current_user.email_domain }}).
{%- endif %}
Agreement signed: {{ current_service.organisation.agreement_signed|format_yes_no(none='Cant tell') }}
{%- if current_service.organisation.agreement_signed %}, on behalf of {{ current_service.organisation.name }}
{%- elif current_service.organisation.name %} (organisation is {{ current_service.organisation.name }}, {{ current_service.organisation.crown|format_yes_no(yes='a crown body', no='a non-crown body', none='crown status unknown') }})
{%- else %} (domain is {{ current_user.email_domain }})
{%- endif %}.
{%- if current_service.organisation.request_to_go_live_notes %} {{ current_service.organisation.request_to_go_live_notes }}{% endif %}
{%- if current_service.organisation.agreement_signed_by %}
Agreement signed by: {{ current_service.organisation.agreement_signed_by.email_address }}