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.

189 lines
8.7 KiB

  1. - content_for :page_title do
  2. = @account.acct
  3. .table-wrapper
  4. %table.table.inline-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. %tr
  16. %th= t('admin.accounts.avatar')
  17. %th
  18. = link_to @account.avatar.url(:original) do
  19. = image_tag @account.avatar.url(:original), alt: '', width: 40, height: 40, class: 'avatar'
  20. - if @account.local? && @account.avatar?
  21. = table_link_to 'trash', t('admin.accounts.remove_avatar'), remove_avatar_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') } if can?(:remove_avatar, @account)
  22. - if @account.local?
  23. %tr
  24. %th= t('admin.accounts.role')
  25. %td
  26. - if @account.user.nil?
  27. = t("admin.accounts.moderation.suspended")
  28. - else
  29. = t("admin.accounts.roles.#{@account.user&.role}")
  30. = 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)
  31. = 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)
  32. %tr
  33. %th= t('admin.accounts.email')
  34. %td
  35. = @account.user_email
  36. = table_link_to 'edit', t('admin.accounts.change_email.label'), admin_account_change_email_path(@account.id) if can?(:change_email, @account.user)
  37. - if @account.user_unconfirmed_email.present?
  38. %th= t('admin.accounts.unconfirmed_email')
  39. %td
  40. = @account.user_unconfirmed_email
  41. %tr
  42. %th= t('admin.accounts.email_status')
  43. %td
  44. - if @account.user&.confirmed?
  45. = t('admin.accounts.confirmed')
  46. - else
  47. = t('admin.accounts.confirming')
  48. = table_link_to 'refresh', t('admin.accounts.resend_confirmation.send'), resend_admin_account_confirmation_path(@account.id), method: :post if can?(:confirm, @account.user)
  49. %tr
  50. %th= t('admin.accounts.login_status')
  51. %td
  52. - if @account.user&.disabled?
  53. = t('admin.accounts.disabled')
  54. = table_link_to 'unlock', t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post if can?(:enable, @account.user)
  55. - else
  56. = t('admin.accounts.enabled')
  57. = table_link_to 'lock', t('admin.accounts.disable'), disable_admin_account_path(@account.id), method: :post if can?(:disable, @account.user)
  58. %tr
  59. %th= t('admin.accounts.most_recent_ip')
  60. %td= @account.user_current_sign_in_ip
  61. %tr
  62. %th= t('admin.accounts.most_recent_activity')
  63. %td
  64. - if @account.user_current_sign_in_at
  65. %time.formatted{ datetime: @account.user_current_sign_in_at.iso8601, title: l(@account.user_current_sign_in_at) }
  66. = l @account.user_current_sign_in_at
  67. - else
  68. Never
  69. - else
  70. %tr
  71. %th= t('admin.accounts.profile_url')
  72. %td= link_to @account.url, @account.url
  73. %tr
  74. %th= t('admin.accounts.protocol')
  75. %td= @account.protocol.humanize
  76. %tr
  77. %th= t('admin.accounts.follows')
  78. %td= number_to_human @account.following_count
  79. %tr
  80. %th= t('admin.accounts.followers')
  81. %td= number_to_human @account.followers_count
  82. %tr
  83. %th= t('admin.accounts.statuses')
  84. %td= link_to number_to_human(@account.statuses_count), admin_account_statuses_path(@account.id)
  85. %tr
  86. %th= t('admin.accounts.media_attachments')
  87. %td
  88. = link_to number_to_human(@account.media_attachments.count), admin_account_statuses_path(@account.id, { media: true })
  89. = surround '(', ')' do
  90. = number_to_human_size @account.media_attachments.sum('file_file_size')
  91. %tr
  92. %th= t('.created_reports')
  93. %td= link_to pluralize(@account.reports.count, t('.report')), admin_reports_path(account_id: @account.id)
  94. %tr
  95. %th= t('.targeted_reports')
  96. %td= link_to pluralize(@account.targeted_reports.count, t('.report')), admin_reports_path(target_account_id: @account.id)
  97. %div{ style: 'overflow: hidden' }
  98. %div{ style: 'float: right' }
  99. - if @account.local?
  100. = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user)
  101. - if @account.user&.otp_required_for_login?
  102. = 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)
  103. - unless @account.memorial?
  104. = 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)
  105. - else
  106. = link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account)
  107. %div{ style: 'float: left' }
  108. - if @account.silenced?
  109. = link_to t('admin.accounts.undo_silenced'), admin_account_silence_path(@account.id), method: :delete, class: 'button' if can?(:unsilence, @account)
  110. - else
  111. = link_to t('admin.accounts.silence'), admin_account_silence_path(@account.id), method: :post, class: 'button' if can?(:silence, @account)
  112. - if @account.local?
  113. - unless @account.user_confirmed?
  114. = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
  115. - if @account.suspended?
  116. = link_to t('admin.accounts.undo_suspension'), admin_account_suspension_path(@account.id), method: :delete, class: 'button' if can?(:unsuspend, @account)
  117. - else
  118. = 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)
  119. - if !@account.local? && @account.hub_url.present?
  120. %hr.spacer/
  121. %h3 OStatus
  122. .table-wrapper
  123. %table.table.inline-table
  124. %tbody
  125. %tr
  126. %th= t('admin.accounts.feed_url')
  127. %td= link_to @account.remote_url, @account.remote_url
  128. %tr
  129. %th= t('admin.accounts.push_subscription_expires')
  130. %td
  131. - if @account.subscribed?
  132. %time.formatted{ datetime: @account.subscription_expires_at.iso8601, title: l(@account.subscription_expires_at) }
  133. = l @account.subscription_expires_at
  134. - else
  135. = t('admin.accounts.not_subscribed')
  136. %tr
  137. %th= t('admin.accounts.salmon_url')
  138. %td= link_to @account.salmon_url, @account.salmon_url
  139. %div{ style: 'overflow: hidden' }
  140. %div{ style: 'float: right' }
  141. = 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)
  142. - if @account.subscribed?
  143. = link_to t('admin.accounts.unsubscribe'), unsubscribe_admin_account_path(@account.id), method: :post, class: 'button negative' if can?(:unsubscribe, @account)
  144. - if !@account.local? && @account.inbox_url.present?
  145. %hr.spacer/
  146. %h3 ActivityPub
  147. .table-wrapper
  148. %table.table.inline-table
  149. %tbody
  150. %tr
  151. %th= t('admin.accounts.inbox_url')
  152. %td= link_to @account.inbox_url, @account.inbox_url
  153. %tr
  154. %th= t('admin.accounts.outbox_url')
  155. %td= link_to @account.outbox_url, @account.outbox_url
  156. %tr
  157. %th= t('admin.accounts.shared_inbox_url')
  158. %td= link_to @account.shared_inbox_url, @account.shared_inbox_url
  159. %tr
  160. %th= t('admin.accounts.followers_url')
  161. %td= link_to @account.followers_url, @account.followers_url
  162. %hr.spacer/
  163. = render @moderation_notes
  164. = simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
  165. = render 'shared/error_messages', object: @account_moderation_note
  166. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  167. = f.hidden_field :target_account_id
  168. .actions
  169. = f.button :button, t('admin.account_moderation_notes.create'), type: :submit