diff --git a/app/assets/stylesheets/_grids.scss b/app/assets/stylesheets/_grids.scss index 5e8643173..490f4d01d 100644 --- a/app/assets/stylesheets/_grids.scss +++ b/app/assets/stylesheets/_grids.scss @@ -2,7 +2,6 @@ @include grid-column(3/4); } - .column-one-eighth { @include grid-column(1/8); } @@ -19,3 +18,11 @@ .bottom-gutter-2-3 { margin-bottom: $gutter * 2/3; } + +.align-with-heading { + display: block; + text-align: center; + margin-top: 45px; + padding-left: 2px; + padding-right: 2px; +} diff --git a/app/assets/stylesheets/views/edit-template.scss b/app/assets/stylesheets/views/edit-template.scss index 3635b067f..dd1c8e789 100644 --- a/app/assets/stylesheets/views/edit-template.scss +++ b/app/assets/stylesheets/views/edit-template.scss @@ -3,7 +3,7 @@ &-placeholder-hint { display: block; padding-top: 20px; - color: $secondary-text-colour; + //color: $secondary-text-colour; } } diff --git a/app/main/views/send.py b/app/main/views/send.py index f80da4eb3..155a55e22 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -37,8 +37,8 @@ send_messages_page_headings = { manage_templates_page_headings = { - 'email': 'Manage templates', - 'sms': 'Manage templates' + 'email': 'Email templates', + 'sms': 'Text message templates' } diff --git a/app/main/views/templates.py b/app/main/views/templates.py index 0b7119e9d..f390ff9af 100644 --- a/app/main/views/templates.py +++ b/app/main/views/templates.py @@ -13,6 +13,11 @@ form_objects = { 'sms': SMSTemplateForm } +page_headings = { + 'email': 'email', + 'sms': 'text message' +} + @main.route("/services//templates/add-", methods=['GET', 'POST']) @login_required @@ -42,7 +47,8 @@ def add_service_template(service_id, template_type): 'views/edit-{}-template.html'.format(template_type), form=form, template_type=template_type, - service_id=service_id + service_id=service_id, + heading_action='Add' ) @@ -70,7 +76,8 @@ def edit_service_template(service_id, template_id): form=form, service_id=service_id, template_id=template_id, - template_type=template['template_type'] + template_type=template['template_type'], + heading_action='Edit' ) diff --git a/app/templates/main_nav.html b/app/templates/main_nav.html index 3f2727e40..bafcfae2e 100644 --- a/app/templates/main_nav.html +++ b/app/templates/main_nav.html @@ -10,9 +10,9 @@ {% elif current_user.has_permissions(['manage_templates']) %} {% endif %} {% if current_user.has_permissions(['manage_users', 'manage_settings']) %} diff --git a/app/templates/views/choose-template.html b/app/templates/views/choose-template.html index 00b4cbc2f..e3d11ed02 100644 --- a/app/templates/views/choose-template.html +++ b/app/templates/views/choose-template.html @@ -10,55 +10,64 @@ {% block maincolumn_content %} -

{{ page_heading }}

+ {% if not templates %} -
+

{{ page_heading }}

- {% if templates %} - {% if not has_jobs %} - {% if current_user.has_permissions(['send_texts', 'send_emails', 'send_letters'], or_=True) %} - {{ banner( - """ - Send yourself a test message - """, - subhead='Next step', - type="tip" - )}} - {% endif %} - {% endif %} -
- {% for template in templates %} -
- {% if 'email' == template_type %} - {{ email_message( - template.subject, - template.formatted_as_markup, - name=template.name - ) }} - {% elif 'sms' == template_type %} - {{ sms_message(template.formatted_as_markup, name=template.name) }} - {% endif %} -
-
- -
- {% endfor %} -
+ {% if current_user.has_permissions(['manage_templates']) %} + Add a new template {% endif %} -

- {% if current_user.has_permissions(['manage_templates']) %} - Add a new template - {% endif %} -

+ {% else %} + +
+
+

{{ page_heading }}

+
+ {% if current_user.has_permissions(['manage_templates']) %} + + {% endif %} +
+ + {% if not has_jobs %} + {% if current_user.has_permissions(['send_texts', 'send_emails', 'send_letters'], or_=True) %} + {{ banner( + """ + Send yourself a test message + """, + subhead='Next step', + type="tip" + )}} + {% endif %} + {% endif %} +
+ {% for template in templates %} +
+ {% if 'email' == template_type %} + {{ email_message( + template.subject, + template.formatted_as_markup, + name=template.name + ) }} + {% elif 'sms' == template_type %} + {{ sms_message(template.formatted_as_markup, name=template.name) }} + {% endif %} +
+
+ +
+ {% endfor %} +
+ {% endif %} -
{% endblock %} diff --git a/app/templates/views/edit-email-template.html b/app/templates/views/edit-email-template.html index 3f9ec239f..0505fc97c 100644 --- a/app/templates/views/edit-email-template.html +++ b/app/templates/views/edit-email-template.html @@ -3,12 +3,14 @@ {% from "components/page-footer.html" import page_footer %} {% block page_title %} - {{ h1 }} – GOV.UK Notify + {{ heading_action }} email template – GOV.UK Notify {% endblock %} {% block maincolumn_content %} -

Edit email template

+

+ {{ heading_action }} email template +

@@ -21,17 +23,19 @@
{{ 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('.choose_template', template_type=template_type, service_id=service_id), - back_link_text='Cancel' + delete_link_text='Delete this template' ) }}
diff --git a/app/templates/views/edit-sms-template.html b/app/templates/views/edit-sms-template.html index b8b44a927..a571c300a 100644 --- a/app/templates/views/edit-sms-template.html +++ b/app/templates/views/edit-sms-template.html @@ -3,12 +3,14 @@ {% from "components/page-footer.html" import page_footer %} {% block page_title %} - {{ h1 }} – GOV.UK Notify + {{ heading_action }} text message template – GOV.UK Notify {% endblock %} {% block maincolumn_content %} -

Edit text message template

+

+ {{ heading_action }} text message template +

@@ -20,17 +22,19 @@
{{ 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('.choose_template', service_id=service_id, template_type=template_type), - back_link_text='Cancel' + delete_link_text='Delete this template' ) }}
diff --git a/app/templates/views/invite-user.html b/app/templates/views/invite-user.html index d4fcf104f..b50b9d663 100644 --- a/app/templates/views/invite-user.html +++ b/app/templates/views/invite-user.html @@ -10,7 +10,7 @@ Manage users – GOV.UK Notify {% block maincolumn_content %}

- {{ user.name or user.email_localpart or "Add a new team member" }} + {{ user.name or user.email_localpart or "Invite a team member" }}

diff --git a/app/templates/views/letters.html b/app/templates/views/letters.html index 1086f1d50..5ef3e4d6f 100644 --- a/app/templates/views/letters.html +++ b/app/templates/views/letters.html @@ -7,7 +7,11 @@ {% block maincolumn_content %}

- Send letters + {% if current_user.has_permissions(['send_letters']) %} + Send letters + {% else %} + Letter templates + {% endif %}

diff --git a/app/templates/views/manage-users.html b/app/templates/views/manage-users.html index 0876f8f5b..e0f7fe1a5 100644 --- a/app/templates/views/manage-users.html +++ b/app/templates/views/manage-users.html @@ -16,11 +16,16 @@ Manage users – GOV.UK Notify {% block maincolumn_content %} -

- Manage team -

- - Invite a team member +
+
+

+ Manage team +

+
+ +
{% call(item) list_table( users, caption='Active', **table_options diff --git a/app/templates/views/service-settings.html b/app/templates/views/service-settings.html index c285f6c7d..b05e06025 100644 --- a/app/templates/views/service-settings.html +++ b/app/templates/views/service-settings.html @@ -7,7 +7,7 @@ {% block maincolumn_content %} -

Service settings

+

Manage settings

{{ browse_list([ { diff --git a/tests/app/main/views/test_manage_users.py b/tests/app/main/views/test_manage_users.py index a335ea8be..d0ed7e571 100644 --- a/tests/app/main/views/test_manage_users.py +++ b/tests/app/main/views/test_manage_users.py @@ -123,7 +123,7 @@ def test_should_show_page_for_inviting_user( client.login(api_user_active) response = client.get(url_for('main.invite_user', service_id=55555)) - assert 'Add a new team member' in response.get_data(as_text=True) + assert 'Invite a team member' in response.get_data(as_text=True) assert response.status_code == 200 @@ -277,6 +277,6 @@ def test_user_cant_invite_themselves( assert response.status_code == 200 page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') - assert page.h1.string.strip() == 'Add a new team member' + assert page.h1.string.strip() == 'Invite a team member' form_error = page.find('span', class_='error-message').string.strip() assert form_error == "You can't send an invitation to yourself"