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.

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