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.

258 lines
13 KiB

  1. - content_for :page_title do
  2. = @account.acct
  3. - if @account.instance_actor?
  4. .flash-message.notice
  5. %strong= t('accounts.instance_actor_flash')
  6. = render 'application/card', account: @account
  7. - account = @account
  8. - proofs = account.identity_proofs.active
  9. - fields = account.fields
  10. - unless fields.empty? && proofs.empty? && account.note.blank?
  11. .admin-account-bio
  12. - unless fields.empty? && proofs.empty?
  13. %div
  14. .account__header__fields
  15. - proofs.each do |proof|
  16. %dl
  17. %dt= proof.provider.capitalize
  18. %dd.verified
  19. = link_to fa_icon('check'), proof.badge.proof_url, class: 'verified__mark', title: t('accounts.link_verified_on', date: l(proof.updated_at))
  20. = link_to proof.provider_username, proof.badge.profile_url
  21. - fields.each do |field|
  22. %dl
  23. %dt.emojify{ title: field.name }= Formatter.instance.format_field(account, field.name, custom_emojify: true)
  24. %dd{ title: field.value, class: custom_field_classes(field) }
  25. - if field.verified?
  26. %span.verified__mark{ title: t('accounts.link_verified_on', date: l(field.verified_at)) }
  27. = fa_icon 'check'
  28. = Formatter.instance.format_field(account, field.value, custom_emojify: true)
  29. - if account.note.present?
  30. %div
  31. .account__header__content.emojify= Formatter.instance.simplified_format(account, custom_emojify: true)
  32. .dashboard__counters.admin-account-counters
  33. %div
  34. = link_to admin_account_statuses_path(@account.id) do
  35. .dashboard__counters__num= number_with_delimiter @account.statuses_count
  36. .dashboard__counters__label= t 'admin.accounts.statuses'
  37. %div
  38. = link_to admin_account_statuses_path(@account.id, { media: true }) do
  39. .dashboard__counters__num= number_to_human_size @account.media_attachments.sum('file_file_size')
  40. .dashboard__counters__label= t 'admin.accounts.media_attachments'
  41. %div
  42. = link_to admin_account_relationships_path(@account.id, location: 'local', relationship: 'followed_by') do
  43. .dashboard__counters__num= number_with_delimiter @account.local_followers_count
  44. .dashboard__counters__label= t 'admin.accounts.followers'
  45. %div
  46. = link_to admin_reports_path(account_id: @account.id) do
  47. .dashboard__counters__num= number_with_delimiter @account.reports.count
  48. .dashboard__counters__label= t '.created_reports'
  49. %div
  50. = link_to admin_reports_path(target_account_id: @account.id) do
  51. .dashboard__counters__num= number_with_delimiter @account.targeted_reports.count
  52. .dashboard__counters__label= t '.targeted_reports'
  53. %div
  54. = link_to admin_action_logs_path(target_account_id: @account.id) do
  55. .dashboard__counters__text
  56. - if @account.local? && @account.user.nil?
  57. = t('admin.accounts.deleted')
  58. - elsif @account.memorial?
  59. = t('admin.accounts.memorialized')
  60. - elsif @account.suspended?
  61. = t('admin.accounts.suspended')
  62. - elsif @account.silenced?
  63. = t('admin.accounts.silenced')
  64. - elsif @account.local? && @account.user&.disabled?
  65. = t('admin.accounts.disabled')
  66. - elsif @account.local? && !@account.user&.confirmed?
  67. = t('admin.accounts.confirming')
  68. - elsif @account.local? && !@account.user_approved?
  69. = t('admin.accounts.pending')
  70. - elsif @account.sensitized?
  71. = t('admin.accounts.sensitive')
  72. - else
  73. = t('admin.accounts.no_limits_imposed')
  74. .dashboard__counters__label= t 'admin.accounts.login_status'
  75. - unless @account.local? && @account.user.nil?
  76. .table-wrapper
  77. %table.table.inline-table
  78. %tbody
  79. - if @account.local?
  80. - if @account.avatar?
  81. %tr
  82. %th= t('admin.accounts.avatar')
  83. %td= 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)
  84. %td
  85. - if @account.header?
  86. %tr
  87. %th= t('admin.accounts.header')
  88. %td= 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)
  89. %td
  90. %tr
  91. %th= t('admin.accounts.role')
  92. %td= t("admin.accounts.roles.#{@account.user&.role}")
  93. %td
  94. = 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)
  95. = 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)
  96. %tr
  97. %th{ rowspan: can?(:create, :email_domain_block) ? 3 : 2 }= t('admin.accounts.email')
  98. %td{ rowspan: can?(:create, :email_domain_block) ? 3 : 2 }= @account.user_email
  99. %td= table_link_to 'edit', t('admin.accounts.change_email.label'), admin_account_change_email_path(@account.id) if can?(:change_email, @account.user)
  100. %tr
  101. %td= table_link_to 'search', t('admin.accounts.search_same_email_domain'), admin_accounts_path(email: "%@#{@account.user_email.split('@').last}")
  102. - if can?(:create, :email_domain_block)
  103. %tr
  104. %td= table_link_to 'ban', t('admin.accounts.add_email_domain_block'), new_admin_email_domain_block_path(_domain: @account.user_email.split('@').last)
  105. - if @account.user_unconfirmed_email.present?
  106. %tr
  107. %th= t('admin.accounts.unconfirmed_email')
  108. %td= @account.user_unconfirmed_email
  109. %td
  110. %tr
  111. %th= t('admin.accounts.email_status')
  112. %td
  113. - if @account.user&.confirmed?
  114. = t('admin.accounts.confirmed')
  115. - else
  116. = t('admin.accounts.confirming')
  117. %td= table_link_to 'refresh', t('admin.accounts.resend_confirmation.send'), resend_admin_account_confirmation_path(@account.id), method: :post if can?(:confirm, @account.user)
  118. %tr
  119. %th= t('simple_form.labels.defaults.locale')
  120. %td= @account.user_locale
  121. %td
  122. %tr
  123. %th= t('admin.accounts.joined')
  124. %td
  125. %time.formatted{ datetime: @account.created_at.iso8601, title: l(@account.created_at) }= l @account.created_at
  126. %td
  127. - @account.user.recent_ips.each_with_index do |(_, ip), i|
  128. %tr
  129. - if i.zero?
  130. %th{ rowspan: @account.user.recent_ips.size }= t('admin.accounts.most_recent_ip')
  131. %td= ip
  132. %td= table_link_to 'search', t('admin.accounts.search_same_ip'), admin_accounts_path(ip: ip)
  133. %tr
  134. %th= t('admin.accounts.most_recent_activity')
  135. %td
  136. - if @account.user_current_sign_in_at
  137. %time.formatted{ datetime: @account.user_current_sign_in_at.iso8601, title: l(@account.user_current_sign_in_at) }= l @account.user_current_sign_in_at
  138. %td
  139. - if @account.user&.invited?
  140. %tr
  141. %th= t('admin.accounts.invited_by')
  142. %td= admin_account_link_to @account.user.invite.user.account
  143. %td
  144. - else
  145. %tr
  146. %th= t('admin.accounts.inbox_url')
  147. %td
  148. = @account.inbox_url
  149. = fa_icon DeliveryFailureTracker.available?(@account.inbox_url) ? 'check' : 'times'
  150. %td
  151. = table_link_to 'search', @domain_block.present? ? t('admin.domain_blocks.view') : t('admin.accounts.view_domain'), admin_instance_path(@account.domain)
  152. %tr
  153. %th= t('admin.accounts.shared_inbox_url')
  154. %td
  155. = @account.shared_inbox_url
  156. = fa_icon DeliveryFailureTracker.available?(@account.shared_inbox_url) ? 'check': 'times'
  157. %td
  158. - if @domain_block.nil?
  159. = table_link_to 'ban', t('admin.domain_blocks.add_new'), new_admin_domain_block_path(_domain: @account.domain)
  160. - if @account.suspended?
  161. %hr.spacer/
  162. %p.muted-hint= @deletion_request.present? ? t('admin.accounts.suspension_reversible_hint_html', date: content_tag(:strong, l(@deletion_request.due_at.to_date))) : t('admin.accounts.suspension_irreversible')
  163. = link_to t('admin.accounts.undo_suspension'), unsuspend_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsuspend, @account)
  164. - if @deletion_request.present?
  165. = link_to t('admin.accounts.delete'), admin_account_path(@account.id), method: :delete, class: 'button button--destructive', data: { confirm: t('admin.accounts.are_you_sure') } if can?(:destroy, @account)
  166. - else
  167. %div.action-buttons
  168. %div
  169. - if @account.local? && @account.user_approved?
  170. = link_to t('admin.accounts.warn'), new_admin_account_action_path(@account.id, type: 'none'), class: 'button' if can?(:warn, @account)
  171. - if @account.user_disabled?
  172. = link_to t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post, class: 'button' if can?(:enable, @account.user)
  173. - else
  174. = link_to t('admin.accounts.disable'), new_admin_account_action_path(@account.id, type: 'disable'), class: 'button' if can?(:disable, @account.user)
  175. - if @account.sensitized?
  176. = link_to t('admin.accounts.undo_sensitized'), unsensitive_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsensitive, @account)
  177. - elsif !@account.local? || @account.user_approved?
  178. = link_to t('admin.accounts.sensitive'), new_admin_account_action_path(@account.id, type: 'sensitive'), class: 'button' if can?(:sensitive, @account)
  179. - if @account.silenced?
  180. = link_to t('admin.accounts.undo_silenced'), unsilence_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsilence, @account)
  181. - elsif !@account.local? || @account.user_approved?
  182. = link_to t('admin.accounts.silence'), new_admin_account_action_path(@account.id, type: 'silence'), class: 'button' if can?(:silence, @account)
  183. - if @account.local?
  184. - if @account.user_pending?
  185. = link_to t('admin.accounts.approve'), approve_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button' if can?(:approve, @account.user)
  186. = link_to t('admin.accounts.reject'), reject_admin_account_path(@account.id), method: :post, data: { confirm: t('admin.accounts.are_you_sure') }, class: 'button button--destructive' if can?(:reject, @account.user)
  187. - unless @account.user_confirmed?
  188. = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
  189. - if !@account.local? || @account.user_approved?
  190. = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@account.id, type: 'suspend'), class: 'button' if can?(:suspend, @account)
  191. %div
  192. - if @account.local?
  193. = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user)
  194. - if @account.user&.otp_required_for_login?
  195. = 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)
  196. - if !@account.memorial? && @account.user_approved?
  197. = 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)
  198. - else
  199. = link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account)
  200. %hr.spacer/
  201. - unless @warnings.empty?
  202. = render @warnings
  203. %hr.spacer/
  204. = render @moderation_notes
  205. = simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
  206. = render 'shared/error_messages', object: @account_moderation_note
  207. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  208. = f.hidden_field :target_account_id
  209. .actions
  210. = f.button :button, t('admin.account_moderation_notes.create'), type: :submit
  211. %hr.spacer/
  212. - if @account.user&.invite_request&.text&.present?
  213. %div.speech-bubble
  214. %div.speech-bubble__bubble
  215. = @account.user&.invite_request&.text
  216. %div.speech-bubble__owner
  217. = admin_account_link_to @account
  218. = t('admin.accounts.invite_request_text')