Change account deletion page to have better explanations (#11753)

Fix deletion of unconfirmed account not freeing up the username

Add prefill of logged-in user's email in the reconfirmation form
This commit is contained in:
Eugen Rochko
2019-09-04 04:13:54 +02:00
committed by GitHub
parent c1e238a77b
commit 43f56f1291
7 changed files with 77 additions and 23 deletions

View File

@ -17,7 +17,4 @@
.simple_form
%p.hint= t('auth.setup.email_settings_hint_html', email: content_tag(:strong, @user.email))
.form-footer
%ul.no-list
%li= link_to t('settings.account_settings'), edit_user_registration_path
%li= link_to t('auth.logout'), destroy_user_session_path, data: { method: :delete }
.form-footer= render 'auth/shared/links'

View File

@ -1,12 +1,18 @@
%ul.no-list
- if controller_name != 'sessions'
%li= link_to t('auth.login'), new_session_path(resource_name)
- if user_signed_in?
%li= link_to t('settings.account_settings'), edit_user_registration_path
- else
- if controller_name != 'sessions'
%li= link_to t('auth.login'), new_user_session_path
- if devise_mapping.registerable? && controller_name != 'registrations'
%li= link_to t('auth.register'), available_sign_up_path
- if controller_name != 'registrations'
%li= link_to t('auth.register'), available_sign_up_path
- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
%li= link_to t('auth.forgot_password'), new_password_path(resource_name)
- if controller_name != 'passwords' && controller_name != 'registrations'
%li= link_to t('auth.forgot_password'), new_user_password_path
- if devise_mapping.confirmable? && controller_name != 'confirmations'
%li= link_to t('auth.didnt_get_confirmation'), new_confirmation_path(resource_name)
- if controller_name != 'confirmations'
%li= link_to t('auth.didnt_get_confirmation'), new_user_confirmation_path
- if user_signed_in? && controller_name != 'setup'
%li= link_to t('auth.logout'), destroy_user_session_path, data: { method: :delete }

View File

@ -2,15 +2,25 @@
= t('settings.delete')
= simple_form_for @confirmation, url: settings_delete_path, method: :delete do |f|
.warning
%strong
= fa_icon('warning')
= t('deletes.warning_title')
= t('deletes.warning_html')
%p.hint= t('deletes.warning.before')
%p.hint= t('deletes.description_html')
%ul.hint
- if current_user.confirmed? && current_user.approved?
%li.warning-hint= t('deletes.warning.irreversible')
%li.warning-hint= t('deletes.warning.username_unavailable')
%li.warning-hint= t('deletes.warning.data_removal')
%li.warning-hint= t('deletes.warning.caches')
- else
%li.positive-hint= t('deletes.warning.email_change_html', path: edit_user_registration_path)
%li.positive-hint= t('deletes.warning.email_reconfirmation_html', path: new_user_confirmation_path)
%li.positive-hint= t('deletes.warning.email_contact_html', email: Setting.site_contact_email)
%li.positive-hint= t('deletes.warning.username_available')
= f.input :password, placeholder: t('simple_form.labels.defaults.current_password'), input_html: { 'aria-label' => t('simple_form.labels.defaults.current_password'), :autocomplete => 'off' }, hint: t('deletes.confirm_password')
%p.hint= t('deletes.warning.more_details_html', terms_path: terms_path)
%hr.spacer/
= f.input :password, wrapper: :with_block_label, input_html: { :autocomplete => 'off' }, hint: t('deletes.confirm_password')
.actions
= f.button :button, t('deletes.proceed'), type: :submit, class: 'negative'