diff --git a/app/assets/stylesheets/components/sms-message.scss b/app/assets/stylesheets/components/sms-message.scss index a72e7c939..268225eac 100644 --- a/app/assets/stylesheets/components/sms-message.scss +++ b/app/assets/stylesheets/components/sms-message.scss @@ -19,7 +19,7 @@ .sms-message-recipient { @include copy-19; color: $secondary-text-colour; - margin: -$gutter-half 0 $gutter 0; + margin: -20px 0 $gutter 0; } .sms-message-name { diff --git a/app/main/forms.py b/app/main/forms.py index fab516607..1edf1ceb9 100644 --- a/app/main/forms.py +++ b/app/main/forms.py @@ -7,7 +7,7 @@ from wtforms import ( ValidationError, TextAreaField, FileField, - SelectField + RadioField ) from wtforms.validators import DataRequired, Email, Length, Regexp @@ -193,8 +193,9 @@ class TemplateForm(Form): name = StringField( u'Template name', validators=[DataRequired(message="Template name cannot be empty")]) - template_type = SelectField(u'Template type', choices=[('sms', 'SMS')]) - content = TextAreaField( + template_type = RadioField(u'Template type', choices=[('sms', 'SMS')]) + + template_content = TextAreaField( u'Message', validators=[DataRequired(message="Template content cannot be empty")]) diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 57866a839..a40d3b8f2 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -40,7 +40,7 @@ def add_service_template(service_id): if form.validate_on_submit(): tdao.insert_service_template( - form.name.data, form.template_type.data, form.content.data, service_id) + form.name.data, form.template_type.data, form.template_content.data, service_id) return redirect(url_for( '.manage_service_templates', service_id=service_id)) return render_template( @@ -60,12 +60,14 @@ def edit_service_template(service_id, template_id): abort(404) else: raise e + + template['template_content'] = template['content'] form = TemplateForm(**template) if form.validate_on_submit(): tdao.update_service_template( template_id, form.name.data, form.template_type.data, - form.content.data, service_id) + form.template_content.data, service_id) return redirect(url_for('.manage_service_templates', service_id=service_id)) return render_template( diff --git a/app/templates/components/sms-message.html b/app/templates/components/sms-message.html index 3b7ee4a28..f526d696d 100644 --- a/app/templates/components/sms-message.html +++ b/app/templates/components/sms-message.html @@ -6,7 +6,6 @@ {% endif %} {% if name %}

- ID: {{ id }} {% if edit_link %} {{ name }} {% else %} @@ -25,6 +24,11 @@ {{ recipient }}

{% endif %} + {% if id %} +

+ Template ID: {{ id }} +

+ {% endif %} {% if input_name %} {% endif %} diff --git a/app/templates/components/table.html b/app/templates/components/table.html index b5fe9e9d2..a37a5ef89 100644 --- a/app/templates/components/table.html +++ b/app/templates/components/table.html @@ -25,14 +25,15 @@ {% macro list_table(items, caption='', empty_message='', field_headings=[], field_headings_visible=True, caption_visible=True) -%} {% set parent_caller = caller %} - {% call mapping_table(caption, field_headings, field_headings_visible, caption_visible) %} - {% for item in items %} - {% call row() %} - {{ parent_caller(item) }} - {% endcall %} - {% endfor %} - {%- endcall %} - {% if not items %} + {% if items %} + {% call mapping_table(caption, field_headings, field_headings_visible, caption_visible) %} + {% for item in items %} + {% call row() %} + {{ parent_caller(item) }} + {% endcall %} + {% endfor %} + {%- endcall %} + {% else %}

{{ empty_message }}

diff --git a/app/templates/main_nav.html b/app/templates/main_nav.html index 8418ec77e..6c7f7fb21 100644 --- a/app/templates/main_nav.html +++ b/app/templates/main_nav.html @@ -9,11 +9,11 @@
  • Templates
  • diff --git a/app/templates/views/edit-template.html b/app/templates/views/edit-template.html index 861e7c4ea..0b0521f71 100644 --- a/app/templates/views/edit-template.html +++ b/app/templates/views/edit-template.html @@ -12,11 +12,20 @@ GOV.UK Notify | Edit template
    {{ textbox(form.name) }} - {{ textbox(form.template_type) }} - {{ textbox(form.content, highlight_tags=True) }} +
    + + Template type + + +
    + {{ textbox(form.template_content, highlight_tags=True) }} {{ page_footer( 'Save', delete_link=url_for('.delete_service_template', service_id=service_id, template_id=template_id) if template_id or None, + delete_link_text='delete this template', back_link=url_for('.manage_service_templates', service_id=service_id), back_link_text='Back to templates' ) }} diff --git a/app/templates/views/service-settings.html b/app/templates/views/service-settings.html index fa29cccee..98ab3b1c9 100644 --- a/app/templates/views/service-settings.html +++ b/app/templates/views/service-settings.html @@ -12,8 +12,7 @@ {{ browse_list([ { 'title': 'Change your service name', - 'link': url_for('.service_name_change', service_id=service_id), - 'hint': 'Your service name ({}) is included in every sent notification'.format(service.name) + 'link': url_for('.service_name_change', service_id=service_id) }, { 'title': 'Request to go live and turn off sending restrictions', @@ -22,15 +21,15 @@ } if not service.live else { }, { - 'title': 'Turn off all outgoing notifications', + 'title': 'Temporarily suspend API keys', 'link': url_for('.service_status_change', service_id=service_id), 'destructive': True } if service.active else { - 'title': 'Restart sending notifications', + 'title': 'Reactivate API keys', 'link': url_for('.service_status_change', service_id=service_id) }, { - 'title': 'Delete this service from Notify', + 'title': 'Delete this service from GOV.UK Notify', 'link': url_for('.service_delete', service_id=service_id), 'destructive': True }, diff --git a/app/templates/views/service-settings/delete.html b/app/templates/views/service-settings/delete.html index 39b6fc843..49401d52e 100644 --- a/app/templates/views/service-settings/delete.html +++ b/app/templates/views/service-settings/delete.html @@ -7,11 +7,13 @@ {% block maincolumn_content %} -

    Delete this service from Notify

    +
    +

    Delete this service from GOV.UK Notify

    +

    This can’t be undone. You will lose:

    @@ -24,7 +26,7 @@ any templates you’ve created
  • - the history of + the history of notifications you’ve sent
  • API keys diff --git a/app/templates/views/service-settings/status.html b/app/templates/views/service-settings/status.html index 2a1980de5..cda74afab 100644 --- a/app/templates/views/service-settings/status.html +++ b/app/templates/views/service-settings/status.html @@ -7,7 +7,7 @@ GOV.UK Notify | Service settings {% block maincolumn_content %} -

    Turn off all outgoing notifications

    +

    Temporarily suspend API keys

    diff --git a/app/templates/views/signedout.html b/app/templates/views/signedout.html index ec6e390dc..81defacfd 100644 --- a/app/templates/views/signedout.html +++ b/app/templates/views/signedout.html @@ -10,15 +10,22 @@ GOV.UK Notify | Get started

    GOV.UK Notify

    -

    Use GOV.UK Notify to send notifications by text message, email and letter.

    -

    We're making it easy to keep your users informed.

    -

    If you work for a UK government department or agency you can set up a test account now.

    +

    + Use GOV.UK Notify to send notifications by text message, email and letter. +

    +

    + We're making it easy to keep your users informed. +

    +

    + If you work for a UK government department or agency you can set up a test account now. +

    +

    + Set up an account +

    +

    + If you've used GOV.UK Notify before, sign in to your account. +

    - Set up an account - - - -

    If you've used GOV.UK Notify before, sign in to your account.

    diff --git a/app/templates/withnav_template.html b/app/templates/withnav_template.html index f01a527c6..dd1060fa3 100644 --- a/app/templates/withnav_template.html +++ b/app/templates/withnav_template.html @@ -8,7 +8,7 @@
    {{ banner( - 'You are in restricted mode. You can only send notifications to yourself.', + 'Your service is in restricted mode. You can only send notifications to yourself.', 'info' ) }} {% block maincolumn_content %}{% endblock %} diff --git a/tests/app/main/views/test_service_settings.py b/tests/app/main/views/test_service_settings.py index 89147c6e2..70458a9f0 100644 --- a/tests/app/main/views/test_service_settings.py +++ b/tests/app/main/views/test_service_settings.py @@ -13,7 +13,6 @@ def test_should_show_overview(app_, db_, db_session, mock_api_user, mock_get_ser resp_data = response.get_data(as_text=True) assert 'Service settings' in resp_data service = mock_get_service.side_effect(service_id)['data'] - assert service['name'] in resp_data assert mock_get_service.called @@ -217,7 +216,7 @@ def test_should_show_delete_page(app_, db_, db_session, mock_api_user, mock_get_ 'main.service_delete', service_id=service_id)) assert response.status_code == 200 - assert 'Delete this service from Notify' in response.get_data(as_text=True) + assert 'Delete this service from GOV.UK Notify' in response.get_data(as_text=True) assert mock_get_service.called diff --git a/tests/app/main/views/test_templates.py b/tests/app/main/views/test_templates.py index 13c3965a7..cdf7284cf 100644 --- a/tests/app/main/views/test_templates.py +++ b/tests/app/main/views/test_templates.py @@ -62,7 +62,7 @@ def test_should_redirect_when_saving_a_template(app_, 'id': template_id, 'name': name, 'template_type': type_, - "content": content, + "template_content": content, "service": service_id } response = client.post(url_for(