show.html.haml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. - content_for :page_title do
  2. = t('settings.migrate')
  3. .simple_form
  4. - if current_account.moved_to_account.present?
  5. .fields-row
  6. .fields-row__column.fields-group.fields-row__column-6
  7. = render 'application/card', account: current_account.moved_to_account
  8. .fields-row__column.fields-group.fields-row__column-6
  9. %p.hint
  10. %span.positive-hint= t('migrations.redirecting_to', acct: current_account.moved_to_account.pretty_acct)
  11. %p.hint= t('migrations.cancel_explanation')
  12. %p.hint= link_to t('migrations.cancel'), settings_migration_redirect_path, data: { method: :delete }
  13. - else
  14. %p.hint
  15. %span.positive-hint= t('migrations.not_redirecting')
  16. %hr.spacer/
  17. %h3= t('auth.migrate_account')
  18. = simple_form_for @migration, url: settings_migration_path do |f|
  19. - if on_cooldown?
  20. %p.hint
  21. %span.warning-hint= t('migrations.on_cooldown', count: ((@cooldown.cooldown_at - Time.now.utc) / 1.day.seconds).ceil)
  22. - else
  23. %p.hint= t('migrations.warning.before')
  24. %ul.hint
  25. %li.warning-hint= t('migrations.warning.followers')
  26. %li.warning-hint= t('migrations.warning.redirect')
  27. %li.warning-hint= t('migrations.warning.other_data')
  28. %li.warning-hint= t('migrations.warning.backreference_required')
  29. %li.warning-hint= t('migrations.warning.cooldown')
  30. %li.warning-hint= t('migrations.warning.disabled_account')
  31. %p.hint= t('migrations.warning.only_redirect_html', path: new_settings_migration_redirect_path)
  32. %hr.spacer/
  33. = render 'shared/error_messages', object: @migration
  34. .fields-row
  35. .fields-row__column.fields-group.fields-row__column-6
  36. = f.input :acct, wrapper: :with_block_label, input_html: { autocapitalize: 'none', autocorrect: 'off' }, disabled: on_cooldown?
  37. .fields-row__column.fields-group.fields-row__column-6
  38. - if current_user.encrypted_password.present?
  39. = f.input :current_password, wrapper: :with_block_label, input_html: { autocomplete: 'current-password' }, required: true, disabled: on_cooldown?
  40. - else
  41. = f.input :current_username, wrapper: :with_block_label, input_html: { autocomplete: 'off' }, required: true, disabled: on_cooldown?
  42. .actions
  43. = f.button :button, t('migrations.proceed_with_move'), type: :submit, class: 'button button--destructive', disabled: on_cooldown?
  44. - unless @migrations.empty?
  45. %hr.spacer/
  46. %h3= t 'migrations.past_migrations'
  47. %hr.spacer/
  48. .table-wrapper
  49. %table.table.inline-table
  50. %thead
  51. %tr
  52. %th= t('migrations.acct')
  53. %th= t('migrations.followers_count')
  54. %th
  55. %tbody
  56. - @migrations.each do |migration|
  57. %tr
  58. %td
  59. - if migration.target_account.present?
  60. = compact_account_link_to migration.target_account
  61. - else
  62. = migration.acct
  63. %td= number_with_delimiter migration.followers_count
  64. %td
  65. %time.time-ago{ datetime: migration.created_at.iso8601, title: l(migration.created_at) }= l(migration.created_at)
  66. %hr.spacer/
  67. %h3= t 'migrations.incoming_migrations'
  68. %p.muted-hint= t('migrations.incoming_migrations_html', path: settings_aliases_path)