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.

196 lines
9.2 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'), disable_admin_account_path(@account.id), method: :post 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= number_to_human @account.followers_count
  89. %tr
  90. %th= t('admin.accounts.statuses')
  91. %td= link_to number_to_human(@account.statuses_count), admin_account_statuses_path(@account.id)
  92. %tr
  93. %th= t('admin.accounts.media_attachments')
  94. %td
  95. = link_to number_to_human(@account.media_attachments.count), admin_account_statuses_path(@account.id, { media: true })
  96. = surround '(', ')' do
  97. = number_to_human_size @account.media_attachments.sum('file_file_size')
  98. %tr
  99. %th= t('.created_reports')
  100. %td= link_to pluralize(@account.reports.count, t('.report')), admin_reports_path(account_id: @account.id)
  101. %tr
  102. %th= t('.targeted_reports')
  103. %td= link_to pluralize(@account.targeted_reports.count, t('.report')), admin_reports_path(target_account_id: @account.id)
  104. %div{ style: 'overflow: hidden' }
  105. %div{ style: 'float: right' }
  106. - if @account.local?
  107. = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user)
  108. - if @account.user&.otp_required_for_login?
  109. = 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)
  110. - unless @account.memorial?
  111. = 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)
  112. - else
  113. = link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account)
  114. %div{ style: 'float: left' }
  115. - if @account.silenced?
  116. = link_to t('admin.accounts.undo_silenced'), admin_account_silence_path(@account.id), method: :delete, class: 'button' if can?(:unsilence, @account)
  117. - else
  118. = link_to t('admin.accounts.silence'), admin_account_silence_path(@account.id), method: :post, class: 'button button--destructive' if can?(:silence, @account)
  119. - if @account.local?
  120. - unless @account.user_confirmed?
  121. = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
  122. - if @account.suspended?
  123. = link_to t('admin.accounts.undo_suspension'), admin_account_suspension_path(@account.id), method: :delete, class: 'button' if can?(:unsuspend, @account)
  124. - else
  125. = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_suspension_path(@account.id), class: 'button button--destructive' if can?(:suspend, @account)
  126. - if !@account.local? && @account.hub_url.present?
  127. %hr.spacer/
  128. %h3 OStatus
  129. .table-wrapper
  130. %table.table.inline-table
  131. %tbody
  132. %tr
  133. %th= t('admin.accounts.feed_url')
  134. %td= link_to @account.remote_url, @account.remote_url
  135. %tr
  136. %th= t('admin.accounts.push_subscription_expires')
  137. %td
  138. - if @account.subscribed?
  139. %time.formatted{ datetime: @account.subscription_expires_at.iso8601, title: l(@account.subscription_expires_at) }
  140. = l @account.subscription_expires_at
  141. - else
  142. = t('admin.accounts.not_subscribed')
  143. %tr
  144. %th= t('admin.accounts.salmon_url')
  145. %td= link_to @account.salmon_url, @account.salmon_url
  146. %div{ style: 'overflow: hidden' }
  147. %div{ style: 'float: right' }
  148. = 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)
  149. - if @account.subscribed?
  150. = link_to t('admin.accounts.unsubscribe'), unsubscribe_admin_account_path(@account.id), method: :post, class: 'button negative' if can?(:unsubscribe, @account)
  151. - if !@account.local? && @account.inbox_url.present?
  152. %hr.spacer/
  153. %h3 ActivityPub
  154. .table-wrapper
  155. %table.table.inline-table
  156. %tbody
  157. %tr
  158. %th= t('admin.accounts.inbox_url')
  159. %td= link_to @account.inbox_url, @account.inbox_url
  160. %tr
  161. %th= t('admin.accounts.outbox_url')
  162. %td= link_to @account.outbox_url, @account.outbox_url
  163. %tr
  164. %th= t('admin.accounts.shared_inbox_url')
  165. %td= link_to @account.shared_inbox_url, @account.shared_inbox_url
  166. %tr
  167. %th= t('admin.accounts.followers_url')
  168. %td= link_to @account.followers_url, @account.followers_url
  169. %hr.spacer/
  170. = render @moderation_notes
  171. = simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
  172. = render 'shared/error_messages', object: @account_moderation_note
  173. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  174. = f.hidden_field :target_account_id
  175. .actions
  176. = f.button :button, t('admin.account_moderation_notes.create'), type: :submit