Files
notifications-admin/app/templates/views/api/whitelist.html
Chris Hill-Scott 74fb30ce5f Add GOV.UK Design System style back links
The Design System has standardised on back links being at the top of the
page, decorated with a small text-coloured arrow.

I think this makes more sense than having them at the bottom, because it
suggests, in some way, being able to go back before commiting to any of
the forms on the page. Whereas the things at the bottom of the page
should be performing actions on what’s in the page.

The reason for making this change now is that it de-clutters the area
around the green buttons. This was presenting a design challenge where
multiple levels of interaction were happening in the same form. Moving
these back links to the top of the page should mean that, in these
complicated forms, there’s one fewer thing to compete for the user’s
attention.

I’ve componentised this into a `page_header` macro so that the change is
easier to roll out and maintain.
2019-04-30 15:29:39 +01:00

73 lines
1.9 KiB
HTML

{% extends "withnav_template.html" %}
{% from "components/banner.html" import banner_wrapper %}
{% from "components/table.html" import list_table, field, hidden_field_heading %}
{% from "components/api-key.html" import api_key %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/list-entry.html" import list_entry %}
{% from "components/form.html" import form_wrapper %}
{% block service_page_title %}
Whitelist
{% endblock %}
{% block maincolumn_content %}
{% if form.email_addresses.errors or form.phone_numbers.errors %}
{% call banner_wrapper(type='dangerous') %}
<h1 class='banner-title'>
There was a problem with your whitelist
</h1>
<p>Fix these errors:</p>
<ul>
{% if form.email_addresses.errors %}
<li>
<a href="#{{ form.email_addresses.name }}">Enter valid email addresses</a>
</li>
{% endif %}
{% if form.phone_numbers.errors %}
<li>
<a href="#{{ form.phone_numbers.name }}">Enter valid phone numbers</a>
</li>
{% endif %}
</ul>
{% endcall %}
{% else %}
{{ page_header(
'Whitelist',
back_link=url_for('main.api_integration', service_id=current_service.id)
) }}
{% endif %}
<p>
You and members of
<a href="{{ url_for('main.manage_users', service_id=current_service.id) }}">your team</a>
are included in the whitelist automatically.
</p>
{% call form_wrapper() %}
<div class="grid-row">
<div class="column-two-thirds">
{{ list_entry(
form.email_addresses,
item_name='email address',
autocomplete=False
) }}
{{ list_entry(
form.phone_numbers,
item_name='phone number',
autocomplete=False
) }}
</div>
</div>
{{ page_footer('Save') }}
{% endcall %}
{% endblock %}