From d1665e71098ef1a2fcbc5795575e5e64e7a742db Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 1 Apr 2016 07:32:02 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Make=20=E2=80=98get=20started=E2=80=99=20wo?= =?UTF-8?q?rk=20for=20emails=20and=20texts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the ‘get started’ block on the dashboard pushed users into starting with a text message. This led to users writing email content into a tet message template because it didn’t match their expectations. Also, the ‘send yourself a test’ link from the dashboard: - wasn’t much used, because users responded to the similar call to action on the choose template page instead - was confusing if you had created an email template because it presupposed that you’d created a text message template So this commit changes the ‘get started’ block to be a choice between creating an email template or a text message template. We reckon that the language of ‘set up’ will help establish that templates are not equivalent to individual messages. This language is now repeated on the ‘choose template’ page when you don’t have templates as well. --- app/templates/views/choose-template.html | 4 +++ app/templates/views/dashboard/dashboard.html | 9 +++--- .../views/dashboard/get-started.html | 31 +++++++++++++------ 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/app/templates/views/choose-template.html b/app/templates/views/choose-template.html index 1b97ad899..2d0b56551 100644 --- a/app/templates/views/choose-template.html +++ b/app/templates/views/choose-template.html @@ -15,6 +15,10 @@

{{ page_heading }}

{% if current_user.has_permissions(permissions=['manage_templates'], any_=True) %} +

+ You need a template before you can send + {{ 'emails' if 'email' == template_type else 'text messages' }} +

Add a new template {% else %}

You need to ask your service manager to add templates before you can send messages

diff --git a/app/templates/views/dashboard/dashboard.html b/app/templates/views/dashboard/dashboard.html index bdf9c1838..4fe589ed5 100644 --- a/app/templates/views/dashboard/dashboard.html +++ b/app/templates/views/dashboard/dashboard.html @@ -10,12 +10,11 @@ {% include 'views/dashboard/trial-mode-banner.html' %} {% endif %} - {% if not jobs %} - {% if current_user.has_permissions(['manage_templates','send_texts', 'send_emails', 'send_letters']) %} - {% include 'views/dashboard/get-started.html' %} - {% endif%} - {% else %} + {% if not templates and current_user.has_permissions(['send_texts', 'send_emails', 'send_letters'], any_=True) %} + {% include 'views/dashboard/get-started.html' %} + {% endif %} + {% if templates %}
Get started -
    - {% if current_user.has_permissions(['manage_templates']) %} +{% if current_user.has_permissions(['manage_templates']) %} +

    + You need to set up a template before you can send messages +

    +
    1. - {% call banner_wrapper(type="tip", subhead='1.' if not templates else None, with_tick=templates|length) %} - Add a template + {% call banner_wrapper(type="tip") %} + + Set up a text message template + {% endcall %}
    2. - {% endif %} - {% if current_user.has_permissions(['send_texts', 'send_emails', 'send_letters']) %}
    3. - {% call banner_wrapper(type="tip", subhead='2.') %} - Send yourself a message + {% call banner_wrapper(type="tip") %} + + Set up an email template + {% endcall %}
    4. - {% endif %} -
    +
+{% else %} +

+

+ You need to ask your service manager to set up some templates before you can send messages +

+

+{% endif %} From 3d9aa931d4aea3621fe9dfe756d2949ae22f842c Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 1 Apr 2016 07:43:47 +0100 Subject: [PATCH 2/2] Remove `service_dashboard.html` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This template wasn’t being used. It was replaced by `dashboard/dashboard.html` in b38ae08ad6f08e0d6b64fd554d9806d3d4d97fdf --- app/templates/views/service_dashboard.html | 76 ---------------------- 1 file changed, 76 deletions(-) delete mode 100644 app/templates/views/service_dashboard.html diff --git a/app/templates/views/service_dashboard.html b/app/templates/views/service_dashboard.html deleted file mode 100644 index de2d7992a..000000000 --- a/app/templates/views/service_dashboard.html +++ /dev/null @@ -1,76 +0,0 @@ -{% extends "withnav_template.html" %} -{% from "components/banner.html" import banner_wrapper %} -{% from "components/table.html" import list_table, field, right_aligned_field_heading %} -{% from "components/big-number.html" import big_number %} - -{% block page_title %} - {{ session.get('service_name', 'Dashboard') }} – GOV.UK Notify -{% endblock %} - -{% block maincolumn_content %} - -
    -
  • - {{ big_number( - free_text_messages_remaining, - 'free text messages remaining' - )}} -
  • -
  • - {{ big_number( - '£' + spent_this_month, - 'spent this month' - )}} -
  • -
- - {% if not template_count and not jobs %} - {% if current_user.has_permissions(['manage_templates', 'send_texts', 'send_emails', 'send_letters'], any_=True, admin_override=True) %} - {% call banner_wrapper(subhead='Get started', type="tip") %} -
    - {% if current_user.has_permissions(['manage_templates'], admin_override=True) %} -
  1. - Add a template -
  2. - {% endif %} - {% if current_user.has_permissions(['send_texts']) %} -
  3. - Send yourself a text message -
  4. - {% endif %} -
- {% endcall %} - {% endif %} - {% elif not jobs %} - {% call banner_wrapper(subhead='Next step', type="tip") %} - {% if current_user.has_permissions(permissions=['send_texts', 'send_emails', 'send_letters']) %} - Send yourself a text message - {% endif %} - {% endcall %} - {% else %} - {% call(item) list_table( - jobs, - caption="Recent text messages", - empty_message='You haven’t sent any batch messages yet', - field_headings=['Job', 'Created', right_aligned_field_heading('completion')] - ) %} - {% call field() %} - {{ item.original_file_name }} - {% endcall %} - {% call field() %} - {{ item.created_at|format_datetime }} - {% endcall %} - {% call field(align='right') %} - {{ (item.notifications_sent / item.notification_count * 100)|round|int }}% - {% endcall %} - {% endcall %} - {% if more_jobs_to_show %} - {% if current_user.has_permissions(permissions=['send_texts', 'send_emails', 'send_letters']) %} - - {% endif %} - {% endif %} - {% endif %} - -{% endblock %}