Skip to content

Commit

Permalink
Use aria labels on change links instead of hiding text on account page (
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdavidhamilton authored Nov 6, 2023
1 parent 9a9f636 commit fe4b684
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/views/user/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@
= govuk_summary_list do |your_details|
- your_details.with_row do |row|
- row.with_key { 'Name' }
- row.with_value(text: current_user.name, classes: ['data-hj-suppress'])
- row.with_action(text: t('links.change'), href: edit_registration_name_path, visually_hidden_text: 'name', html_attributes: { id: :edit_name_registration })
- row.with_value(text: current_user.name, classes: %w[data-hj-suppress])
- row.with_action(text: t('links.change'), href: edit_registration_name_path, html_attributes: { id: :edit_name_registration, aria: { label: 'Change name' } })
- your_details.with_row do |row|
- row.with_key { 'Email' }
- row.with_value(text:current_user.email, classes: ['data-hj-suppress'])
- row.with_action(text: t('links.change'), href: edit_email_user_path, visually_hidden_text: 'email', html_attributes: { id: :edit_email_user })
- row.with_value(text:current_user.email, classes: %w[data-hj-suppress])
- row.with_action(text: t('links.change'), href: edit_email_user_path, html_attributes: { id: :edit_email_user, aria: { label: 'Change email' } })
- your_details.with_row do |row|
- row.with_key { 'Password' }
- row.with_value { t('my_account.password_changed', date: current_user.password_last_changed) }
- row.with_action(text: t('links.change'), href: edit_password_user_path, visually_hidden_text: 'password', html_attributes: { id: :edit_password_user })
- row.with_action(text: t('links.change'), href: edit_password_user_path, html_attributes: { id: :edit_password_user, aria: { label: 'Change password' } })

= govuk_summary_list do |other_details|
- other_details.with_row do |row|
- row.with_key { m('my_account.setting_details') }
- row.with_value { nil }
- row.with_action(text: t('links.change'), href: edit_registration_setting_type_path, visually_hidden_text: 'setting_type', html_attributes: { id: :edit_setting_type_registration })
- row.with_action(text: t('links.change'), href: edit_registration_setting_type_path, html_attributes: { id: :edit_setting_type_registration, aria: { label: 'Change setting details' } })
- other_details.with_row do |row|
- row.with_key { 'Setting type' }
- row.with_value(text: current_user.setting_name, classes: ['data-hj-suppress'])
- row.with_value(text: current_user.setting_name, classes: %w[data-hj-suppress])
- other_details.with_row do |row|
- row.with_key { 'Local authority' }
- row.with_value(text: current_user.authority_name, classes: ['data-hj-suppress'])
- row.with_value(text: current_user.authority_name, classes: %w[data-hj-suppress])
- other_details.with_row do |row|
- row.with_key { 'Role' }
- row.with_value(text: current_user.role_name, classes: ['data-hj-suppress'])
- row.with_value(text: current_user.role_name, classes: %w[data-hj-suppress])

= govuk_summary_list do |email_preferences|
- email_preferences.with_row do |row|
Expand All @@ -45,7 +45,7 @@
- email_preferences.with_row do |row|
- row.with_key { 'Email updates about this training course' }
- row.with_value(text: t(current_user.training_emails_recipient?, scope: 'my_account.training_emails'), classes: %w[data-hj-suppress])
- row.with_action(text: t('links.change'), href: edit_training_emails_user_path, visually_hidden_text: 'training_emails', html_attributes: { id: :edit_training_emails_user })
- row.with_action(text: t('links.change'), href: edit_training_emails_user_path, html_attributes: { id: :edit_training_emails_user, aria: { label: 'Change email preferences' } })

= m('my_account.closing.information')
= govuk_button_link_to t('my_account.closing.button'), new_user_close_account_path

0 comments on commit fe4b684

Please sign in to comment.