From 41624295c91e24e6b9e154812a82c8055907809f Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Tue, 14 Jul 2020 14:45:56 +0100 Subject: [PATCH] Refactor conditional inside paragraph This will make it easier to add more branches later. --- app/templates/views/templates/choose.html | 30 +++++++++-------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/app/templates/views/templates/choose.html b/app/templates/views/templates/choose.html index db0851de4..6a536c8ca 100644 --- a/app/templates/views/templates/choose.html +++ b/app/templates/views/templates/choose.html @@ -21,25 +21,19 @@

{{ page_title }}

- {% if current_user.has_permissions('manage_templates') %} -

+ +

+ {% if current_user.has_permissions('manage_templates') %} You need a template before you can send - {% if 'letter' in current_service.permissions %} - emails, text messages or letters - {%- else -%} - emails or text messages - {%- endif %}. -

- {% else %} -

- You need to ask your service manager to add templates before you can send - {% if 'letter' in current_service.permissions %} - emails, text messages or letters - {%- else -%} - emails or text messages - {%- endif %}. -

- {% endif %} + {% else %} + You need to ask your service manager to add templates before you can send + {% endif %} + {% if 'letter' in current_service.permissions %} + emails, text messages or letters + {%- else -%} + emails or text messages + {%- endif %}. +

{% else %}