From 46f8dd3c79b82d6822b0d95c90cb3e9064cb279f Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 1 Jul 2016 07:04:55 +0100 Subject: [PATCH 1/5] =?UTF-8?q?Move=20=E2=80=98send=20test=E2=80=99=20link?= =?UTF-8?q?=20back=20to=20template=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This changes it back to how it was when we first introduced this feature: https://github.com/alphagov/notifications-admin/pull/181 It’s kind of lost on the page where you upload a file, which is a shame because it’s a good teaching aid. --- app/main/views/send.py | 13 +++++++++---- app/templates/views/send-test.html | 2 +- app/templates/views/send.html | 4 +--- app/templates/views/templates/_template.html | 5 ++++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/main/views/send.py b/app/main/views/send.py index c3a0fcb2f..faeb3acf4 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -242,11 +242,16 @@ def check_messages(service_id, template_type, upload_id): ) if current_service['restricted'] else None ) - if request.args.get('from_test') and len(template.placeholders): + if request.args.get('from_test'): extra_args = {'help': 1} if request.args.get('help', '0') != '0' else {} - back_link = url_for( - '.send_test', service_id=service_id, template_id=template.id, **extra_args - ) + if len(template.placeholders): + back_link = url_for( + '.send_test', service_id=service_id, template_id=template.id, **extra_args + ) + else: + back_link = url_for( + '.choose_template', service_id=service_id, template_type=template.template_type, **extra_args + ) else: back_link = url_for('.send_messages', service_id=service_id, template_id=template.id) diff --git a/app/templates/views/send-test.html b/app/templates/views/send-test.html index 95f298c30..600a3d2b4 100644 --- a/app/templates/views/send-test.html +++ b/app/templates/views/send-test.html @@ -14,7 +14,7 @@ {% if request.args['help'] %}

Example text message

{% else %} -

Send a test

+

Send yourself a test

{% endif %} {% if 'sms' == template.template_type %} diff --git a/app/templates/views/send.html b/app/templates/views/send.html index 4b85152bc..8247eee35 100644 --- a/app/templates/views/send.html +++ b/app/templates/views/send.html @@ -35,9 +35,7 @@ diff --git a/app/templates/views/templates/_template.html b/app/templates/views/templates/_template.html index fca57b9fa..3cfd64051 100644 --- a/app/templates/views/templates/_template.html +++ b/app/templates/views/templates/_template.html @@ -26,7 +26,10 @@ Send {{ 'text messages' if 'sms' == template.template_type else 'emails' }} - {% endif %} + + Send yourself a test + + {% endif %} {% if current_user.has_permissions(permissions=['manage_templates'], admin_override=True) %} Edit template {% endif %} From 8c05c082498315a3e9edb9686a6b758443f04b31 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 1 Jul 2016 07:06:11 +0100 Subject: [PATCH 2/5] =?UTF-8?q?Reword=20=E2=80=98send=20emails=E2=80=99=20?= =?UTF-8?q?to=20=E2=80=98upload=20recipients=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …and change the page heading on next page to match. ‘Send emails’ doesn’t speak to you if you already have the idea of a file or address book in mind. ‘Upload’ better describes what you’re going to do on the next page. Also makes all the links regular weight, because having the first one bold looked like a heading. --- app/assets/stylesheets/components/message.scss | 4 ---- app/templates/views/send.html | 4 ++-- app/templates/views/templates/_template.html | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/components/message.scss b/app/assets/stylesheets/components/message.scss index bf8a2c8ab..bcac5f7a5 100644 --- a/app/assets/stylesheets/components/message.scss +++ b/app/assets/stylesheets/components/message.scss @@ -29,10 +29,6 @@ } - .primary { - @include bold-19; - } - } } diff --git a/app/templates/views/send.html b/app/templates/views/send.html index 8247eee35..b66dfb639 100644 --- a/app/templates/views/send.html +++ b/app/templates/views/send.html @@ -11,7 +11,7 @@ {% block maincolumn_content %} -

Send {{ 'text messages' if 'sms' == template.template_type else 'emails' }}

+

Upload recipients

{% if 'sms' == template.template_type %}
@@ -35,7 +35,7 @@ diff --git a/app/templates/views/templates/_template.html b/app/templates/views/templates/_template.html index 3cfd64051..50cf966f9 100644 --- a/app/templates/views/templates/_template.html +++ b/app/templates/views/templates/_template.html @@ -24,7 +24,7 @@ -
- +

Your file needs to look like this example

+
+ {% call(item, row_number) list_table( + example, + caption="Example", + caption_visible=False, + field_headings=[''] + column_headings + ) %} + {{ index_field(row_number - 1) }} + {% for column in item %} + {{ text_field(column) }} + {% endfor %} + {% endcall %} +
+
- -
+

Accepted file formats

+
    +
  • .csv
  • +
  • .tsv
  • +
  • Open Document Spreadsheet (.ods)
  • +
  • Microsoft Excel (.xls, .xlsx, .xlsm)
  • +

    {% endblock %} From 3241710a961798d1b472a31428c96c8288bac3b0 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 1 Jul 2016 07:39:39 +0100 Subject: [PATCH 4/5] Rename check and confirm to preview MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’ve seen people land on this page and expect the message to be on their phone already. ‘Check and confirm’ sounds a lot like ‘check your phone’, which is language that we use earlier on when we _have_ sent a message. Hopefully ‘preview’ is a better indication that it’s not sent yet. --- app/templates/views/check.html | 4 ++-- app/templates/views/send-test.html | 2 +- tests/app/main/views/test_send.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/templates/views/check.html b/app/templates/views/check.html index 539ed320f..9f3571dad 100644 --- a/app/templates/views/check.html +++ b/app/templates/views/check.html @@ -9,7 +9,7 @@ {% from "components/message-count-label.html" import message_count_label %} {% block page_title %} - {{ "Error" if errors else "Check and confirm" }} – GOV.UK Notify + {{ "Error" if errors else "Preview" }} – GOV.UK Notify {% endblock %} {% block maincolumn_content %} @@ -136,7 +136,7 @@ {% else %}

    - Check and confirm + Preview

    {% endif %} diff --git a/app/templates/views/send-test.html b/app/templates/views/send-test.html index 600a3d2b4..a8b4c66b6 100644 --- a/app/templates/views/send-test.html +++ b/app/templates/views/send-test.html @@ -54,7 +54,7 @@ {% endfor %} {% endcall %} - {{ page_footer("Check and confirm", back_link=( + {{ page_footer("Preview", back_link=( url_for('.send_messages', service_id=current_service.id, template_id=template.id)) if not request.args['help'] else None ) }} diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index 4f3f431a3..44062872e 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -694,7 +694,7 @@ def test_send_and_check_page_renders_if_no_statistics( today = datetime.today().date().strftime('%Y-%m-%d') assert resp.status_code == 200 page = BeautifulSoup(resp.data.decode('utf-8'), 'html.parser') - assert page.h1.text.strip() == 'Check and confirm' + assert page.h1.text.strip() == 'Preview' mock_get_stats.assert_called_once_with(fake_uuid, today) From 924dda4ef2b063f787f57e6cd835dfddf04c5a57 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 1 Jul 2016 09:18:29 +0100 Subject: [PATCH 5/5] Fix back link on send test --- app/templates/views/send-test.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/views/send-test.html b/app/templates/views/send-test.html index a8b4c66b6..980ba2a1b 100644 --- a/app/templates/views/send-test.html +++ b/app/templates/views/send-test.html @@ -55,7 +55,7 @@ {% endcall %} {{ page_footer("Preview", back_link=( - url_for('.send_messages', service_id=current_service.id, template_id=template.id)) if not request.args['help'] else None + url_for('.choose_template', service_id=current_service.id, template_type=template.template_type)) if not request.args['help'] else None ) }}