From bcf538fa108b76277639680516aff22430599db4 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 18 Jul 2018 09:56:21 +0100 Subject: [PATCH] Remove separation between upload and send MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that you can access upload from within the send one off message flow, it doesn’t need its own linkbutton on the template page. --- app/templates/views/templates/_template.html | 49 +++++++++++--------- tests/app/main/views/test_templates.py | 4 +- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/app/templates/views/templates/_template.html b/app/templates/views/templates/_template.html index f7a7d4d37..fbe220c8c 100644 --- a/app/templates/views/templates/_template.html +++ b/app/templates/views/templates/_template.html @@ -14,27 +14,34 @@ {% else %}
- {% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %} - - - {% endif %} - {% if - current_user.has_permissions('manage_templates') and - template.template_type != 'letter' - %} - + {% if template.template_type == 'letter' %} + {% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %} + + + {% endif %} + {% else %} + {% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %} + + {% endif %} + {% if current_user.has_permissions('manage_templates') %} + + {% endif %} {% endif %}
diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index 21cf91ac0..0d7215b33 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -205,12 +205,12 @@ def test_caseworker_redirected_to_one_off( ), ( ['send_messages'], - ['.send_messages', '.set_sender'], + ['.set_sender'], None, ), ( ['send_messages', 'manage_templates'], - ['.send_messages', '.set_sender', '.edit_service_template'], + ['.set_sender', '.edit_service_template'], None, ), ])