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.

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