From eea8ae5be484faeef8a2a521f12139dd814fbfa3 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 11 Mar 2016 07:47:46 +0000 Subject: [PATCH] =?UTF-8?q?Move=20=E2=80=98new=20thing=E2=80=99=20buttons?= =?UTF-8?q?=20alongside=20heading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the send messages and manage team pages we have big green buttons for adding/inviting a new template or team member. On the add template page it was at the bottom, and often got missed. On the manage team page it was at the top, but maybe too prominent because it’s big and green. This commit tries putting it in the top right of the page instead (except when the template page is empty, in which case it’s unchanged). --- app/assets/stylesheets/_grids.scss | 9 +- app/templates/views/choose-template.html | 101 ++++++++++++---------- app/templates/views/invite-user.html | 2 +- app/templates/views/manage-users.html | 15 ++-- app/templates/views/service-settings.html | 2 +- tests/app/main/views/test_manage_users.py | 4 +- 6 files changed, 77 insertions(+), 56 deletions(-) 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/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/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/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"