diff --git a/app/views/profile/index.html.slim b/app/views/profile/index.html.slim
index 5178465adfb..413f4a79c6d 100644
--- a/app/views/profile/index.html.slim
+++ b/app/views/profile/index.html.slim
@@ -53,12 +53,16 @@ h2.h3.my0
.sm-col.sm-col-5.px1 = t('.email')
.sm-col.sm-col-5.px1.truncate = current_user.email
.sm-col.sm-col-2.px1.sm-right-align
- = link_to t('forms.buttons.edit'), manage_email_path, class: btn_cls
+ = link_to manage_email_path, class: btn_cls do
+ span.hide = t('.email')
+ = t('forms.buttons.edit')
.py-12p.border-top.border-bottom
.clearfix.mxn1
.sm-col.sm-col-10.px1 = t('.password')
.sm-col.sm-col-2.px1.sm-right-align
- = link_to t('forms.buttons.edit'), manage_password_path, class: btn_cls
+ = link_to manage_password_path, class: btn_cls do
+ span.hide = t('.password')
+ = t('forms.buttons.edit')
.mt3.mb1.h6.bold.caps.ls-0
| #{t('headings.profile.two_factor')}#{tooltip(t('tooltips.two_factor'))}
.py-12p.border-top
@@ -66,23 +70,28 @@ h2.h3.my0
.sm-col.sm-col-5.px1 = t('.phone')
.sm-col.sm-col-5.px1 = current_user.phone
.sm-col.sm-col-2.px1.sm-right-align
- = link_to t('forms.buttons.edit'), manage_phone_path, class: btn_cls
+ = link_to manage_phone_path, class: btn_cls do
+ span.hide = t('.phone')
+ = t('forms.buttons.edit')
.py-12p.border-top
.clearfix.mxn1
.sm-col.sm-col-10.px1 = t('.authentication_app')
.sm-col.sm-col-2.px1.sm-right-align
- if current_user.totp_enabled?
- = button_to t('forms.buttons.disable'), disable_totp_url, \
- method: :delete, class: btn_cls
+ = button_to disable_totp_url, method: :delete, class: btn_cls do
+ span.hide = t('.authentication_app')
+ = t('forms.buttons.disable')
- else
- = link_to t('forms.buttons.enable'), authenticator_start_url, \
- class: btn_cls
+ = link_to authenticator_start_url, class: btn_cls do
+ span.hide = t('.authentication_app')
+ = t('forms.buttons.enable')
.py-12p.border-top.border-bottom
.clearfix.mxn1
.sm-col.sm-col-10.px1 = t('profile.items.recovery_code')
.sm-col.sm-col-2.px1.sm-right-align
- = link_to t('profile.links.regenerate_recovery_code'), \
- manage_recovery_code_path, class: btn_cls
+ = link_to manage_recovery_code_path, class: btn_cls do
+ span.hide = t('profile.items.recovery_code')
+ = t('profile.links.regenerate_recovery_code')
h2.h3.my0 = t('headings.profile.account_history')
.mt2.mb2
diff --git a/spec/views/profile/index.html.slim_spec.rb b/spec/views/profile/index.html.slim_spec.rb
index 9975b660c3d..3ce2da92142 100644
--- a/spec/views/profile/index.html.slim_spec.rb
+++ b/spec/views/profile/index.html.slim_spec.rb
@@ -37,8 +37,8 @@
render
- expect(rendered).to have_xpath("//input[@value='Disable']")
- expect(rendered).not_to have_link('Enable', href: authenticator_start_path)
+ expect(rendered).to have_button t('forms.buttons.disable')
+ expect(rendered).not_to have_link(t('forms.buttons.enable'), href: authenticator_start_path)
end
end