edit.html.haml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. - content_for :page_title do
  2. = t('settings.account_settings')
  3. - if self_destruct?
  4. .flash-message.warning
  5. = t('auth.status.self_destruct', domain: ENV.fetch('LOCAL_DOMAIN'))
  6. - else
  7. = render partial: 'status', locals: { user: @user, strikes: @strikes }
  8. %h3= t('auth.security')
  9. = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'auth_edit', novalidate: false }) do |f|
  10. = render 'shared/error_messages', object: resource
  11. - if (!use_seamless_external_login? || resource.encrypted_password.present?) && !omniauth_only?
  12. .fields-row
  13. .fields-row__column.fields-group.fields-row__column-6
  14. = f.input :email, wrapper: :with_label, input_html: { 'aria-label': t('simple_form.labels.defaults.email') }, required: true, disabled: current_account.suspended?
  15. .fields-row__column.fields-group.fields-row__column-6
  16. = f.input :current_password, wrapper: :with_label, input_html: { 'aria-label': t('simple_form.labels.defaults.current_password'), autocomplete: 'current-password' }, required: true, disabled: current_account.suspended?, hint: false
  17. .fields-row
  18. .fields-row__column.fields-group.fields-row__column-6
  19. = f.input :password, wrapper: :with_label, label: t('simple_form.labels.defaults.new_password'), input_html: { 'aria-label': t('simple_form.labels.defaults.new_password'), autocomplete: 'new-password', minlength: User.password_length.first, maxlength: User.password_length.last }, hint: t('simple_form.hints.defaults.password'), disabled: current_account.suspended?
  20. .fields-row__column.fields-group.fields-row__column-6
  21. = f.input :password_confirmation, wrapper: :with_label, label: t('simple_form.labels.defaults.confirm_new_password'), input_html: { 'aria-label': t('simple_form.labels.defaults.confirm_new_password'), autocomplete: 'new-password' }, disabled: current_account.suspended?
  22. .actions
  23. = f.button :button, t('generic.save_changes'), type: :submit, class: 'button', disabled: current_account.suspended?
  24. - elsif omniauth_only? && sso_account_settings.present?
  25. = link_to t('users.go_to_sso_account_settings'), sso_account_settings
  26. - else
  27. %p.hint= t('users.seamless_external_login')
  28. %hr.spacer/
  29. = render partial: 'sessions', object: @sessions
  30. - unless current_account.suspended? || self_destruct?
  31. %hr.spacer/
  32. %h3= t('auth.migrate_account')
  33. %p.muted-hint= t('auth.migrate_account_html', path: settings_migration_path)
  34. %hr.spacer/
  35. %h3= t('migrations.incoming_migrations')
  36. %p.muted-hint= t('migrations.incoming_migrations_html', path: settings_aliases_path)
  37. %hr.spacer/
  38. %h3= t('auth.delete_account')
  39. %p.muted-hint= t('auth.delete_account_html', path: settings_delete_path)