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.

186 lines
8.1 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. %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. - if @account.user_confirmed?
  37. = fa_icon('check')
  38. %tr
  39. %th= t('admin.accounts.login_status')
  40. %td
  41. - if @account.user&.disabled?
  42. = t('admin.accounts.disabled')
  43. = table_link_to 'unlock', t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post if can?(:enable, @account.user)
  44. - else
  45. = t('admin.accounts.enabled')
  46. = table_link_to 'lock', t('admin.accounts.disable'), disable_admin_account_path(@account.id), method: :post if can?(:disable, @account.user)
  47. %tr
  48. %th= t('admin.accounts.most_recent_ip')
  49. %td= @account.user_current_sign_in_ip
  50. %tr
  51. %th= t('admin.accounts.most_recent_activity')
  52. %td
  53. - if @account.user_current_sign_in_at
  54. %time.formatted{ datetime: @account.user_current_sign_in_at.iso8601, title: l(@account.user_current_sign_in_at) }
  55. = l @account.user_current_sign_in_at
  56. - else
  57. Never
  58. - else
  59. %tr
  60. %th= t('admin.accounts.profile_url')
  61. %td= link_to @account.url, @account.url
  62. %tr
  63. %th= t('admin.accounts.protocol')
  64. %td= @account.protocol.humanize
  65. %tr
  66. %th= t('admin.accounts.follows')
  67. %td= @account.following_count
  68. %tr
  69. %th= t('admin.accounts.followers')
  70. %td= @account.followers_count
  71. %tr
  72. %th= t('admin.accounts.statuses')
  73. %td= link_to @account.statuses_count, admin_account_statuses_path(@account.id)
  74. %tr
  75. %th= t('admin.accounts.media_attachments')
  76. %td
  77. = link_to @account.media_attachments.count, admin_account_statuses_path(@account.id, { media: true })
  78. = surround '(', ')' do
  79. = number_to_human_size @account.media_attachments.sum('file_file_size')
  80. %tr
  81. %th= t('.created_reports')
  82. %td= link_to pluralize(@account.reports.count, t('.report')), admin_reports_path(account_id: @account.id)
  83. %tr
  84. %th= t('.targeted_reports')
  85. %td= link_to pluralize(@account.targeted_reports.count, t('.report')), admin_reports_path(target_account_id: @account.id)
  86. %div{ style: 'overflow: hidden' }
  87. %div{ style: 'float: right' }
  88. - if @account.local?
  89. = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user)
  90. - if @account.user&.otp_required_for_login?
  91. = 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)
  92. - unless @account.memorial?
  93. = 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)
  94. - else
  95. = link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account)
  96. %div{ style: 'float: left' }
  97. - if @account.silenced?
  98. = link_to t('admin.accounts.undo_silenced'), admin_account_silence_path(@account.id), method: :delete, class: 'button' if can?(:unsilence, @account)
  99. - else
  100. = link_to t('admin.accounts.silence'), admin_account_silence_path(@account.id), method: :post, class: 'button' if can?(:silence, @account)
  101. - if @account.local?
  102. - unless @account.user_confirmed?
  103. = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
  104. - if @account.suspended?
  105. = link_to t('admin.accounts.undo_suspension'), admin_account_suspension_path(@account.id), method: :delete, class: 'button' if can?(:unsuspend, @account)
  106. - else
  107. = 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)
  108. - if !@account.local? && @account.hub_url.present?
  109. %hr
  110. %h3 OStatus
  111. .table-wrapper
  112. %table.table
  113. %tbody
  114. %tr
  115. %th= t('admin.accounts.feed_url')
  116. %td= link_to @account.remote_url, @account.remote_url
  117. %tr
  118. %th= t('admin.accounts.push_subscription_expires')
  119. %td
  120. - if @account.subscribed?
  121. %time.formatted{ datetime: @account.subscription_expires_at.iso8601, title: l(@account.subscription_expires_at) }
  122. = l @account.subscription_expires_at
  123. - else
  124. = t('admin.accounts.not_subscribed')
  125. %tr
  126. %th= t('admin.accounts.salmon_url')
  127. %td= link_to @account.salmon_url, @account.salmon_url
  128. %div{ style: 'overflow: hidden' }
  129. %div{ style: 'float: right' }
  130. = 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)
  131. - if @account.subscribed?
  132. = link_to t('admin.accounts.unsubscribe'), unsubscribe_admin_account_path(@account.id), method: :post, class: 'button negative' if can?(:unsubscribe, @account)
  133. - if !@account.local? && @account.inbox_url.present?
  134. %hr
  135. %h3 ActivityPub
  136. .table-wrapper
  137. %table.table
  138. %tbody
  139. %tr
  140. %th= t('admin.accounts.inbox_url')
  141. %td= link_to @account.inbox_url, @account.inbox_url
  142. %tr
  143. %th= t('admin.accounts.outbox_url')
  144. %td= link_to @account.outbox_url, @account.outbox_url
  145. %tr
  146. %th= t('admin.accounts.shared_inbox_url')
  147. %td= link_to @account.shared_inbox_url, @account.shared_inbox_url
  148. %tr
  149. %th= t('admin.accounts.followers_url')
  150. %td= link_to @account.followers_url, @account.followers_url
  151. %hr
  152. %h3= t('admin.accounts.moderation_notes')
  153. = simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
  154. = render 'shared/error_messages', object: @account_moderation_note
  155. = f.input :content
  156. = f.hidden_field :target_account_id
  157. .actions
  158. = f.button :button, t('admin.account_moderation_notes.create'), type: :submit
  159. .table-wrapper
  160. %table.table
  161. %thead
  162. %tr
  163. %th
  164. %th= t('admin.account_moderation_notes.account')
  165. %th= t('admin.account_moderation_notes.created_at')
  166. %tbody
  167. = render @moderation_notes