Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 18 additions & 9 deletions app/views/profile/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -53,36 +53,45 @@ 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
.clearfix.mxn1
.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
Expand Down
4 changes: 2 additions & 2 deletions spec/views/profile/index.html.slim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down