You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
7.4 KiB

  1. - content_for :page_title do
  2. = @account.acct
  3. .table-wrapper
  4. %table.table
  5. %tbody
  6. %tr
  7. %th= t('admin.accounts.username')
  8. %td= @account.username
  9. %tr
  10. %th= t('admin.accounts.domain')
  11. %td= @account.domain
  12. %tr
  13. %th= t('admin.accounts.display_name')
  14. %td= @account.display_name
  15. - if @account.local?
  16. %tr
  17. %th= t('admin.accounts.role')
  18. %td
  19. = t("admin.accounts.roles.#{@account.user&.role}")
  20. = table_link_to 'angle-double-up', t('admin.accounts.promote'), promote_admin_account_role_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:promote, @account.user)
  21. = table_link_to 'angle-double-down', t('admin.accounts.demote'), demote_admin_account_role_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:demote, @account.user)
  22. %tr
  23. %th= t('admin.accounts.email')
  24. %td
  25. = @account.user_email
  26. - if @account.user_confirmed?
  27. = fa_icon('check')
  28. %tr
  29. %th= t('admin.accounts.login_status')
  30. %td
  31. - if @account.user&.disabled?
  32. = t('admin.accounts.disabled')
  33. = table_link_to 'unlock', t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post if can?(:enable, @account.user)
  34. - else
  35. = t('admin.accounts.enabled')
  36. = table_link_to 'lock', t('admin.accounts.disable'), disable_admin_account_path(@account.id), method: :post if can?(:disable, @account.user)
  37. %tr
  38. %th= t('admin.accounts.most_recent_ip')
  39. %td= @account.user_current_sign_in_ip
  40. %tr
  41. %th= t('admin.accounts.most_recent_activity')
  42. %td
  43. - if @account.user_current_sign_in_at
  44. %time.formatted{ datetime: @account.user_current_sign_in_at.iso8601, title: l(@account.user_current_sign_in_at) }
  45. = l @account.user_current_sign_in_at
  46. - else
  47. Never
  48. - else
  49. %tr
  50. %th= t('admin.accounts.profile_url')
  51. %td= link_to @account.url, @account.url
  52. %tr
  53. %th= t('admin.accounts.protocol')
  54. %td= @account.protocol.humanize
  55. %tr
  56. %th= t('admin.accounts.follows')
  57. %td= @account.following_count
  58. %tr
  59. %th= t('admin.accounts.followers')
  60. %td= @account.followers_count
  61. %tr
  62. %th= t('admin.accounts.statuses')
  63. %td= link_to @account.statuses_count, admin_account_statuses_path(@account.id)
  64. %tr
  65. %th= t('admin.accounts.media_attachments')
  66. %td
  67. = link_to @account.media_attachments.count, admin_account_statuses_path(@account.id, { media: true })
  68. = surround '(', ')' do
  69. = number_to_human_size @account.media_attachments.sum('file_file_size')
  70. %tr
  71. %th= t('.created_reports')
  72. %td= link_to pluralize(@account.reports.count, t('.report')), admin_reports_path(account_id: @account.id)
  73. %tr
  74. %th= t('.targeted_reports')
  75. %td= link_to pluralize(@account.targeted_reports.count, t('.report')), admin_reports_path(target_account_id: @account.id)
  76. %div{ style: 'overflow: hidden' }
  77. %div{ style: 'float: right' }
  78. - if @account.local?
  79. = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user)
  80. - if @account.user&.otp_required_for_login?
  81. = link_to t('admin.accounts.disable_two_factor_authentication'), admin_user_two_factor_authentication_path(@account.user.id), method: :delete, class: 'button' if can?(:disable_2fa, @account.user)
  82. - unless @account.memorial?
  83. = link_to t('admin.accounts.memorialize'), memorialize_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button' if can?(:memorialize, @account)
  84. - else
  85. = link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account)
  86. %div{ style: 'float: left' }
  87. - if @account.silenced?
  88. = link_to t('admin.accounts.undo_silenced'), admin_account_silence_path(@account.id), method: :delete, class: 'button' if can?(:unsilence, @account)
  89. - else
  90. = link_to t('admin.accounts.silence'), admin_account_silence_path(@account.id), method: :post, class: 'button' if can?(:silence, @account)
  91. - if @account.local?
  92. - unless @account.user_confirmed?
  93. = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
  94. - if @account.suspended?
  95. = link_to t('admin.accounts.undo_suspension'), admin_account_suspension_path(@account.id), method: :delete, class: 'button' if can?(:unsuspend, @account)
  96. - else
  97. = link_to t('admin.accounts.perform_full_suspension'), admin_account_suspension_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button' if can?(:suspend, @account)
  98. - unless @account.local?
  99. %hr
  100. %h3 OStatus
  101. .table-wrapper
  102. %table.table
  103. %tbody
  104. %tr
  105. %th= t('admin.accounts.feed_url')
  106. %td= link_to @account.remote_url, @account.remote_url
  107. %tr
  108. %th= t('admin.accounts.push_subscription_expires')
  109. %td
  110. - if @account.subscribed?
  111. %time.formatted{ datetime: @account.subscription_expires_at.iso8601, title: l(@account.subscription_expires_at) }
  112. = l @account.subscription_expires_at
  113. - else
  114. = t('admin.accounts.not_subscribed')
  115. %tr
  116. %th= t('admin.accounts.salmon_url')
  117. %td= link_to @account.salmon_url, @account.salmon_url
  118. %div{ style: 'overflow: hidden' }
  119. %div{ style: 'float: right' }
  120. = link_to @account.subscribed? ? t('admin.accounts.resubscribe') : t('admin.accounts.subscribe'), subscribe_admin_account_path(@account.id), method: :post, class: 'button' if can?(:subscribe, @account)
  121. - if @account.subscribed?
  122. = link_to t('admin.accounts.unsubscribe'), unsubscribe_admin_account_path(@account.id), method: :post, class: 'button negative' if can?(:unsubscribe, @account)
  123. %hr
  124. %h3 ActivityPub
  125. .table-wrapper
  126. %table.table
  127. %tbody
  128. %tr
  129. %th= t('admin.accounts.inbox_url')
  130. %td= link_to @account.inbox_url, @account.inbox_url
  131. %tr
  132. %th= t('admin.accounts.outbox_url')
  133. %td= link_to @account.outbox_url, @account.outbox_url
  134. %tr
  135. %th= t('admin.accounts.shared_inbox_url')
  136. %td= link_to @account.shared_inbox_url, @account.shared_inbox_url
  137. %tr
  138. %th= t('admin.accounts.followers_url')
  139. %td= link_to @account.followers_url, @account.followers_url
  140. %hr
  141. %h3= t('admin.accounts.moderation_notes')
  142. = simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
  143. = render 'shared/error_messages', object: @account_moderation_note
  144. = f.input :content
  145. = f.hidden_field :target_account_id
  146. .actions
  147. = f.button :button, t('admin.account_moderation_notes.create'), type: :submit
  148. .table-wrapper
  149. %table.table
  150. %thead
  151. %tr
  152. %th
  153. %th= t('admin.account_moderation_notes.account')
  154. %th= t('admin.account_moderation_notes.created_at')
  155. %tbody
  156. = render @moderation_notes