From 8e7e072df96823943303c45a2cbad471f3e2a1d1 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Thu, 5 Aug 2021 13:57:07 +0100 Subject: [PATCH] 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. --- app/templates/views/user-profile.html | 42 +++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/app/templates/views/user-profile.html b/app/templates/views/user-profile.html index b0680987f..9fc1c835d 100644 --- a/app/templates/views/user-profile.html +++ b/app/templates/views/user-profile.html @@ -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 %}