From 810dc03628ab8e2c7cfc89b01829f1a72a7d1dd9 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 24 Dec 2020 14:10:37 +0000 Subject: [PATCH] Make broadcast template editor expand to fit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s fiddly having to scroll within a small textbox to see all the content. Let’s make the box expand to fit the contents like we do elsewhere. This was removed by accident when we stopped highlighting placeholders in broadcast templates in https://github.com/alphagov/notifications-admin/pull/3672/files --- app/templates/views/edit-broadcast-template.html | 2 +- tests/app/main/views/test_templates.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/templates/views/edit-broadcast-template.html b/app/templates/views/edit-broadcast-template.html index 8c5d7cfe9..21b0374d3 100644 --- a/app/templates/views/edit-broadcast-template.html +++ b/app/templates/views/edit-broadcast-template.html @@ -24,7 +24,7 @@ }) }}
- {{ textbox(form.template_content, highlight_placeholders=False, width='1-1', rows=5) }} + {{ textbox(form.template_content, highlight_placeholders=False, autosize=True, width='1-1', rows=5) }} {{ sticky_page_footer('Save') }}
diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index c7aac09a7..a45fcb06e 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -480,6 +480,7 @@ def test_broadcast_template_doesnt_highlight_placeholders( service_id=SERVICE_ONE_ID, template_id=fake_uuid, ) + assert page.select_one('textarea')['data-module'] == 'enhanced-textbox' assert page.select_one('textarea')['data-highlight-placeholders'] == 'false'