Give user profile change links more context

They all currently say 'Change' which makes it
confusing when they are viewed out of their
context (ie. when all the links in the page are
listed out by a screen reader).

This gives them a suffix relating to the thing
they will change, like the links on the service
settings page.
This commit is contained in:
Tom Byers
2021-08-05 13:57:07 +01:00
parent af6b1d38b5
commit 8e7e072df9

View File

@@ -20,14 +20,24 @@
{% call row() %}
{{ text_field('Name') }}
{{ text_field(current_user.name) }}
{{ edit_field('Change', url_for('.user_profile_name')) }}
{{ edit_field(
'Change',
url_for('.user_profile_name'),
suffix='name'
)
}}
{% endcall %}
{% call row() %}
{{ text_field('Email address') }}
{{ text_field(current_user.email_address) }}
{% if can_see_edit %}
{{ edit_field('Change', url_for('.user_profile_email')) }}
{{ edit_field(
'Change',
url_for('.user_profile_email'),
suffix='email address'
)
}}
{% else %}
{{ text_field('') }}
{% endif %}
@@ -36,13 +46,23 @@
{% call row() %}
{{ text_field('Mobile number') }}
{{ optional_text_field(current_user.mobile_number) }}
{{ edit_field('Change', url_for('.user_profile_mobile_number')) }}
{{ edit_field(
'Change',
url_for('.user_profile_mobile_number'),
suffix='mobile number'
)
}}
{% endcall %}
{% call row() %}
{{ text_field('Password') }}
{{ text_field('Last changed ' + current_user.password_changed_at|format_delta) }}
{{ edit_field('Change', url_for('.user_profile_password')) }}
{{ edit_field(
'Change',
url_for('.user_profile_password'),
suffix='password'
)
}}
{% endcall %}
{% if current_user.can_use_webauthn %}
@@ -52,7 +72,12 @@
('{} registered'.format(current_user.webauthn_credentials|length)) if current_user.webauthn_credentials else None,
default='None registered'
) }}
{{ edit_field('Change', url_for('.user_profile_security_keys')) }}
{{ edit_field(
'Change',
url_for('.user_profile_security_keys'),
suffix='security keys'
)
}}
{% endcall %}
{% endif %}
@@ -60,7 +85,12 @@
{% call row(id='disable-platform-admin') %}
{{ text_field('Use platform admin view') }}
{{ text_field('Yes' if not session.get('disable_platform_admin_view') else 'No') }}
{{ edit_field('Change', url_for('.user_profile_disable_platform_admin_view')) }}
{{ edit_field(
'Change',
url_for('.user_profile_disable_platform_admin_view'),
suffix='whether to use platform admin view'
)
}}
{% endcall %}
{% endif %}