Test passed, good time to commit

This commit is contained in:
Jonathan Bobel
2023-06-16 14:55:24 -04:00
parent 618ac6df8d
commit f266084ddb
50 changed files with 110 additions and 104 deletions

View File

@@ -26,7 +26,7 @@
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
{{ govukButton({
"text": "" if thing else delete_button,
"html": delete_button + "<span class=\"govuk-visually-hidden\"> " + thing + "</span>" if thing else "",
"html": delete_button + "<span class=\"usa-sr-only\"> " + thing + "</span>" if thing else "",
"name": "delete",
"classes": "margin-top-2 usa-button--secondary",
}) }}

View File

@@ -5,7 +5,7 @@
{% for item in items %}
{% if item.title and item.link %}
<li class="browse-list-item">
<a href="{{ item.link }}" class="govuk-link govuk-link--{% if item.destructive %}--destructive{% else %}--no-visited-state{% endif %}">{{ item.title }}</a>
<a href="{{ item.link }}" class="usa-link usa-link{% if item.destructive %}--destructive{% else %}--no-visited-state{% endif %}">{{ item.title }}</a>
{% if item.hint %}
<div class="browse-list-hint">
{{ item.hint }}

View File

@@ -6,7 +6,7 @@
{% endif %}
<div data-module="copy-to-clipboard" data-value="{{ value }}" data-thing="{{ thing }}" data-name="{{ name }}">
<span class="copy-to-clipboard__value">
{%- if name|lower != thing|lower %}<span class="govuk-visually-hidden">{{ thing }}: </span>{% endif %}{{ value -}}
{%- if name|lower != thing|lower %}<span class="usa-sr-only">{{ thing }}: </span>{% endif %}{{ value -}}
</span>
<span class="copy-to-clipboard__notice" aria-live="assertive"></span>
</div>

View File

@@ -13,7 +13,7 @@
) %}
<form method="post" enctype="multipart/form-data" {% if action %}action="{{ action }}"{% endif %} class="{% if field.errors and show_errors %}form-group-error{% endif %}" data-module="file-upload">
<label class="file-upload-label" for="{{ field.name }}">
<span class="govuk-visually-hidden">{{ field.label.text }}</span>
<span class="usa-sr-only">{{ field.label.text }}</span>
{% if hint %}
<span class="form-hint">
{{ hint }}

View File

@@ -45,7 +45,7 @@
"id": "input-" + field_name,
"name": field_name,
"label": {
"html": '<span class="govuk-visually-hidden">' + item_name + ' number </span>' + loop.index|string + '.',
"html": '<span class="usa-sr-only">' + item_name + ' number </span>' + loop.index|string + '.',
"classes": label_classes
},
"classes": "govuk-input--numbered govuk-!-width-full",

View File

@@ -19,7 +19,7 @@
{% if show %}
<div class="live-search js-header" data-module="live-search" data-targets="{{ target_selector }}">
{{ form.search(param_extensions=param_extensions) }}
<div aria-live="polite" class="live-search__status govuk-visually-hidden"></div>
<div aria-live="polite" class="live-search__status usa-sr-only"></div>
</div>
{% endif %}
{% endmacro %}

View File

@@ -23,7 +23,7 @@
{% if button_value %}{% set _ = button_data.update({"value": button_value}) %}{% endif %}
{% if button_text_hidden_suffix %}
{% set _ = button_data.update({
"text": "", "html": button_text + "<span class=\"govuk-visually-hidden\"> " + button_text_hidden_suffix + "</span>"
"text": "", "html": button_text + "<span class=\"usa-sr-only\"> " + button_text_hidden_suffix + "</span>"
}) %}
{% endif %}

View File

@@ -43,7 +43,7 @@
{% endif %}
<fieldset id="{{ field.id }}" {% if inline %}class="inline"{% endif %}>
<legend class="{{ 'form-label' if not hide_legend else '' }}{% if legend_style != 'text' %} {{ legend_style }}{% endif %}">
{% if hide_legend %}<span class="govuk-visually-hidden">{% endif %}
{% if hide_legend %}<span class="usa-sr-only">{% endif %}
{{ field.label.text|safe }}
{% if hide_legend %}</span>{% endif %}
{% if hint %}

View File

@@ -1,6 +1,6 @@
{% macro mapping_table(caption='', field_headings=[], field_headings_visible=True, caption_visible=True, equal_length=False) -%}
<table class="table usa-table usa-table--borderless table-font-xsmall">
<caption class="heading-medium table-heading{{ ' govuk-visually-hidden' if not caption_visible}}">
<caption class="heading-medium table-heading{{ ' usa-sr-only' if not caption_visible}}">
{{ caption }}
</caption>
<thead class="table-field-headings{% if field_headings_visible %}-visible{% endif %}">
@@ -10,7 +10,7 @@
{% if field_headings_visible %}
{{ field_heading }}
{% else %}
<span class="govuk-visually-hidden">{{ field_heading }}</span>
<span class="usa-sr-only">{{ field_heading }}</span>
{% endif %}
</th>
{% endfor %}
@@ -141,7 +141,7 @@
{%- endmacro %}
{% macro hidden_field_heading(text) %}
<span class="govuk-visually-hidden">{{ text }}</span>
<span class="usa-sr-only">{{ text }}</span>
{%- endmacro %}

View File

@@ -2,12 +2,12 @@
<li>
{% if yes %}
<span class="tick-cross-tick">
<span class="govuk-visually-hidden">{{ truthy_hint }}</span>
<span class="usa-sr-only">{{ truthy_hint }}</span>
{{ label}}
</span>
{% else %}
<span class="tick-cross-cross">
<span class="govuk-visually-hidden">{{ falsey_hint }}</span>
<span class="usa-sr-only">{{ falsey_hint }}</span>
{{ label}}
</span>
{% endif %}

View File

@@ -1,2 +1,2 @@
<a href="{%- if params.href %}{{ params.href }}{% else %}#{% endif -%}" class="usa-link usa-back-link display-flex margin-top-5{%- if params.classes %} {{ params.classes }}{% endif -%}"
<a href="{%- if params.href %}{{ params.href }}{% else %}#{% endif -%}" class="usa-link usa-back-link display-inline-flex margin-top-5{%- if params.classes %} {{ params.classes }}{% endif -%}"
{%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ (params.html | safe if params.html else (params.text if params.text else 'Back')) }}</a>

View File

@@ -1,6 +1,6 @@
{% set visuallyHiddenText = params.visuallyHiddenText | default("Error") -%}
<span {%- if params.id %} id="{{ params.id }}"{% endif %} class="usa-error-message{%- if params.classes %} {{ params.classes }}{% endif %}" {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
{% if visuallyHiddenText %}<span class="govuk-visually-hidden">{{ visuallyHiddenText }}:</span> {% endif -%}
{% if visuallyHiddenText %}<span class="usa-sr-only">{{ visuallyHiddenText }}:</span> {% endif -%}
{{ params.html | safe if params.html else params.text }}
</span>

View File

@@ -35,7 +35,7 @@
<div class="govuk-footer__meta">
<div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
{% if params.meta %}
<h2 class="govuk-visually-hidden">{{ params.meta.visuallyHiddenTitle | default("Support links") }}</h2>
<h2 class="usa-sr-only">{{ params.meta.visuallyHiddenTitle | default("Support links") }}</h2>
{% if params.meta.items %}
<ul class="govuk-footer__inline-list">
{% for item in params.meta.items %}
@@ -101,7 +101,7 @@
<div class="govuk-footer__meta border-top border-gray-10">
<div class="govuk-footer__meta-item govuk-footer__meta-item--grow padding-top-2">
{% if params.meta %}
<h2 class="govuk-visually-hidden">{{ params.meta.visuallyHiddenTitle | default("Support links") }}</h2>
<h2 class="usa-sr-only">{{ params.meta.visuallyHiddenTitle | default("Support links") }}</h2>
{% if params.meta.items %}
<ul class="govuk-footer__inline-list">
{% for item in params.meta.items %}

View File

@@ -49,7 +49,7 @@
{% else %}
{% call field(align='right', status='error') %}
<a class="govuk-link govuk-link--destructive" href='{{ url_for('.revoke_api_key', service_id=current_service.id, key_id=item.id) }}'>
Revoke<span class="govuk-visually-hidden"> {{ item.name }}</span>
Revoke<span class="usa-sr-only"> {{ item.name }}</span>
</a>
{% endcall %}
{% endif %}

View File

@@ -142,7 +142,7 @@
caption=original_file_name,
caption_visible=False,
field_headings=[
'<span class="govuk-visually-hidden">Row in file</span><span aria-hidden="true">1</span>'|safe
'<span class="usa-sr-only">Row in file</span><span aria-hidden="true">1</span>'|safe
] + column_headers
) %}
{% call index_field() %}

View File

@@ -59,7 +59,7 @@
caption=original_file_name,
caption_visible=False,
field_headings=[
'<span class="govuk-visually-hidden">Row in file</span><span aria-hidden="true">1</span>'|safe
'<span class="usa-sr-only">Row in file</span><span aria-hidden="true">1</span>'|safe
] + recipients.column_headers
) %}
{% call index_field() %}

View File

@@ -57,7 +57,7 @@
caption="Errors in " + original_file_name,
caption_visible=False,
field_headings=[
'<span class="govuk-visually-hidden">Row in file</span><span aria-hidden="true" class="table-field-invisible-error">1</span>'|safe
'<span class="usa-sr-only">Row in file</span><span aria-hidden="true" class="table-field-invisible-error">1</span>'|safe
] + recipients.column_headers
) %}
{% for item in recipients.displayed_rows %}

View File

@@ -21,7 +21,7 @@
{% endif %}
{% for org in organisations|sort %}
<li class="browse-list-item">
<a href="{{ url_for('.organisation_dashboard', org_id=org.id) }}" class="govuk-link govuk-link--no-visited-state">{{ org.name }}</a>
<a href="{{ url_for('.organisation_dashboard', org_id=org.id) }}" class="usa-link">{{ org.name }}</a>
<p class="browse-list-hint">
{{ org.count_of_live_services }}
live service{% if org.count_of_live_services != 1 %}s{% endif %}
@@ -30,7 +30,7 @@
{% endfor %}
{% for service in services|sort %}
<li class="browse-list-item">
<a href="{{ url_for('.service_dashboard', service_id=service.id) }}" class="govuk-link govuk-link--no-visited-state">{{ service.name }}</a>
<a href="{{ url_for('.service_dashboard', service_id=service.id) }}" class="usa-link">{{ service.name }}</a>
</li>
{% endfor %}
{% if show_heading and (services or organisations) %}
@@ -49,7 +49,7 @@
{% block maincolumn_content %}
<h1 class="heading-large {% if current_user.has_access_to_live_and_trial_mode_services %}govuk-visually-hidden{% endif %}">
<h1 class="heading-large {% if current_user.has_access_to_live_and_trial_mode_services %}usa-sr-only{% endif %}">
Choose service
</h1>
@@ -64,7 +64,7 @@
</div>
<ul class="govuk-grid-column-three-quarters">
<li class="browse-list-item">
<a href="{{ url_for('.organisations') }}" class="govuk-link govuk-link--no-visited-state">All organisations</a>
<a href="{{ url_for('.organisations') }}" class="usa-link">All organisations</a>
<p class="browse-list-hint">
{{ org_count|format_thousands }} organisations, {{ live_service_count|format_thousands }} live services
</p>

View File

@@ -28,7 +28,7 @@
Essential cookies keep your information secure while you use Notify. We do not need to ask permission to use them.
</p>
<table>
<caption class="govuk-visually-hidden">Essential cookies</caption>
<caption class="usa-sr-only">Essential cookies</caption>
<thead>
<tr>
<th>Name</th>
@@ -78,7 +78,7 @@
<li>any errors you see while using Notify</li>
</ul>
<table>
<caption class="govuk-visually-hidden">Google Analytics cookies</caption>
<caption class="usa-sr-only">Google Analytics cookies</caption>
<thead>
<tr>
<th>Name</th>

View File

@@ -28,7 +28,7 @@
<p class="usa-body">
{{ user.email_address }}&emsp;
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.edit_user_email', service_id=current_service.id, user_id=user.id)}}">
Change<span class="govuk-visually-hidden"> email address</span>
Change<span class="usa-sr-only"> email address</span>
</a>
</p>
<p class="usa-body">
@@ -38,7 +38,7 @@
<p class="usa-body" id="user_mobile_number">
{{ mobile_number }}&emsp;
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('.edit_user_mobile_number', service_id=current_service.id, user_id=user.id)}}">
Change<span class="govuk-visually-hidden"> mobile number</span>
Change<span class="usa-sr-only"> mobile number</span>
</a>
</p>
{% endif %}

View File

@@ -41,7 +41,7 @@
<ul>
{% for service in services_found %}
<li class="browse-list-item">
<a href="{{url_for('.service_dashboard', service_id=service.id)}}" class="govuk-link govuk-link--no-visited-state">{{ service.name }}</a>
<a href="{{url_for('.service_dashboard', service_id=service.id)}}" class="usa-link">{{ service.name }}</a>
</li>
<hr>
{% endfor %}

View File

@@ -72,9 +72,9 @@
<div class="govuk-grid-column-one-quarter">
{% if current_user.has_permissions('manage_service') %}
{% if user.status == 'pending' %}
<a class="user-list-edit-link govuk-link govuk-link--no-visited-state" href="{{ url_for('.cancel_invited_user', service_id=current_service.id, invited_user_id=user.id)}}">Cancel invitation<span class="govuk-visually-hidden"> for {{ user.email_address }}</span></a>
<a class="user-list-edit-link govuk-link govuk-link--no-visited-state" href="{{ url_for('.cancel_invited_user', service_id=current_service.id, invited_user_id=user.id)}}">Cancel invitation<span class="usa-sr-only"> for {{ user.email_address }}</span></a>
{% elif user.is_editable_by(current_user) %}
<a class="user-list-edit-link govuk-link govuk-link--no-visited-state" href="{{ url_for('.edit_user_permissions', service_id=current_service.id, user_id=user.id)}}">Change details<span class="govuk-visually-hidden"> for {{ user.name }} {{ user.email_address }}</span></a>
<a class="user-list-edit-link govuk-link govuk-link--no-visited-state" href="{{ url_for('.edit_user_permissions', service_id=current_service.id, user_id=user.id)}}">Change details<span class="usa-sr-only"> for {{ user.name }} {{ user.email_address }}</span></a>
{% endif %}
{% endif %}
</div>

View File

@@ -53,9 +53,9 @@
</div>
<div class="govuk-grid-column-one-quarter">
{% if user.status == 'pending' %}
<a class="govuk-link govuk-link--no-visited-state user-list-edit-link" href="{{ url_for('.cancel_invited_org_user', org_id=current_org.id, invited_user_id=user.id)}}">Cancel invitation<span class="govuk-visually-hidden"> for {{ user.email_address }}</span></a>
<a class="govuk-link govuk-link--no-visited-state user-list-edit-link" href="{{ url_for('.cancel_invited_org_user', org_id=current_org.id, invited_user_id=user.id)}}">Cancel invitation<span class="usa-sr-only"> for {{ user.email_address }}</span></a>
{% elif user.status != 'cancelled' %}
<a class="govuk-link govuk-link--destructive user-list-edit-link" href="{{ url_for('.edit_organisation_user', org_id=current_org.id, user_id=user.id)}}">Remove<span class="govuk-visually-hidden"> {{ user.name }} {{ user.email_address }}</span></a>
<a class="govuk-link govuk-link--destructive user-list-edit-link" href="{{ url_for('.edit_organisation_user', org_id=current_org.id, user_id=user.id)}}">Remove<span class="usa-sr-only"> {{ user.name }} {{ user.email_address }}</span></a>
{% endif %}
</div>
</div>

View File

@@ -109,15 +109,15 @@
</h2>
<div class="govuk-grid-row bottom-gutter">
<div class="govuk-grid-column-one-half">
<span class="govuk-visually-hidden">There are</span>
<span class="usa-sr-only">There are</span>
<div class="product-page-big-number">{{ count_of_live_services_and_organisations.organisations|format_thousands }}</div>
organizations
</div>
<div class="govuk-grid-column-one-half">
<span class="govuk-visually-hidden">and</span>
<span class="usa-sr-only">and</span>
<div class="product-page-big-number">{{ count_of_live_services_and_organisations.services|format_thousands }}</div>
services
<span class="govuk-visually-hidden">using Notify.</span>
<span class="usa-sr-only">using Notify.</span>
</div>
</div>
<div class="dashboard-table">

View File

@@ -103,7 +103,7 @@
Essential cookies keep your information secure while you use Notify. We do not need to ask permission to use them.
</p>
<table>
<caption class="govuk-visually-hidden">Essential cookies</caption>
<caption class="usa-sr-only">Essential cookies</caption>
<thead>
<tr>
<th>Name</th>
@@ -153,7 +153,7 @@
<li>any errors you see while using Notify</li>
</ul>
<table>
<caption class="govuk-visually-hidden">Google Analytics cookies</caption>
<caption class="usa-sr-only">Google Analytics cookies</caption>
<thead>
<tr>
<th>Name</th>

View File

@@ -21,7 +21,7 @@ Create an account
well as the password, but should not be visible to users, nor should
the view process the input.
#}
<div class="govuk-visually-hidden">
<div class="usa-sr-only">
<label for="username" aria-hidden="true">Email</label>
<input type="email" name="username" id="username" value="{{ invited_user.email_address }}" disabled="disabled" tabindex="-1" aria-hidden="true" autocomplete="username" />
</div>

View File

@@ -38,7 +38,7 @@
<div class="govuk-grid-column-one-quarter">
{% if current_user.has_permissions('manage_service') %}
<a class="govuk-link govuk-link--no-visited-state user-list-edit-link"href="{{ url_for('.service_edit_email_reply_to', service_id =current_service.id, reply_to_email_id = item.id) }}">
Change<span class="govuk-visually-hidden"> {{ item.email_address }}</span>
Change<span class="usa-sr-only"> {{ item.email_address }}</span>
</a>
{% endif %}
</div>

View File

@@ -224,15 +224,15 @@ U.S. Notify
<h2>Whos using U.S. Notify</h2>
<div class="govuk-grid-row bottom-gutter">
<div class="govuk-grid-column-one-half">
<span class="govuk-visually-hidden">There are</span>
<span class="usa-sr-only">There are</span>
<div class="product-page-big-number">{{ counts.organisations|format_thousands }}</div>
<span>organizations</span>
</div>
<div class="govuk-grid-column-one-half">
<span class="govuk-visually-hidden">and</span>
<span class="usa-sr-only">and</span>
<div class="product-page-big-number">{{ counts.services|format_thousands }}</div>
<span>services</span>
<span class="govuk-visually-hidden">using Notify.</span>
<span class="usa-sr-only">using Notify.</span>
</div>
</div>
<p>
@@ -246,12 +246,12 @@ U.S. Notify
<h2>Pricing</h2>
<div class="govuk-grid-row bottom-gutter">
<div class="govuk-grid-column-one-half">
<h3 class="govuk-visually-hidden">Emails</h3>
<h3 class="usa-sr-only">Emails</h3>
<div class="product-page-big-number">Unlimited</div>
<span>free emails</span>
</div>
<div class="govuk-grid-column-one-half">
<h3 class="govuk-visually-hidden">Text messages</h3>
<h3 class="usa-sr-only">Text messages</h3>
<div class="product-page-big-number">Up to 40,000</div>
<span>free text messages a year,<br>
then {{ sms_rate }} pence per message</span>

View File

@@ -34,7 +34,7 @@
{{ page_footer('Continue', button_name='operation', button_value='add-new-template') }}
</div>
</div>
<div class="selection-counter govuk-visually-hidden" role="status" aria-live="polite">
<div class="selection-counter usa-sr-only" role="status" aria-live="polite">
Nothing selected
</div>
</div>

View File

@@ -19,7 +19,7 @@
<div class="usa-button-group">
{% if current_user.has_permissions('send_messages', restrict_admin_usage=True) %}
<a href="{{ url_for(".set_sender", service_id=current_service.id, template_id=template.id) }}" class="usa-button usa-pill-separate-item">
Prepare to send<span class="govuk-visually-hidden"> a message using this template</span>
Prepare to send<span class="usa-sr-only"> a message using this template</span>
</a>
{% endif %}
{% if current_user.has_permissions('manage_templates') %}

View File

@@ -53,7 +53,7 @@
{% endset %}
{% set label_content %}
<span class="govuk-visually-hidden">
<span class="usa-sr-only">
{%- for ancestor in item.ancestors %}{{ format_item_name(ancestor.name, separators=False) }} {% endfor -%}
{{ format_item_name(item.name, separators=False) -}}
</span>

View File

@@ -50,7 +50,7 @@
</div>
{% if current_user.has_permissions('manage_templates') and current_template_folder_id and user_has_template_folder_permission %}
<div class="govuk-grid-column-one-sixth">
<a href="{{ url_for('.manage_template_folder', service_id=current_service.id, template_folder_id=current_template_folder_id) }}" class="govuk-link govuk-link--no-visited-state folder-heading-manage-link">Manage<span class="govuk-visually-hidden"> this folder</span></a>
<a href="{{ url_for('.manage_template_folder', service_id=current_service.id, template_folder_id=current_template_folder_id) }}" class="govuk-link govuk-link--no-visited-state folder-heading-manage-link">Manage<span class="usa-sr-only"> this folder</span></a>
</div>
{% endif %}
</div>