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.

185 lines
8.8 KiB

  1. - content_for :page_title do
  2. = @account.acct
  3. = render 'application/card', account: @account
  4. .dashboard__counters{ style: 'margin-top: 10px' }
  5. %div
  6. = link_to admin_account_statuses_path(@account.id) do
  7. .dashboard__counters__num= number_with_delimiter @account.statuses_count
  8. .dashboard__counters__label= t 'admin.accounts.statuses'
  9. %div
  10. = link_to admin_account_statuses_path(@account.id, { media: true }) do
  11. .dashboard__counters__num= number_to_human_size @account.media_attachments.sum('file_file_size')
  12. .dashboard__counters__label= t 'admin.accounts.media_attachments'
  13. %div
  14. = link_to admin_account_followers_path(@account.id) do
  15. .dashboard__counters__num= number_with_delimiter @account.local_followers_count
  16. .dashboard__counters__label= t 'admin.accounts.followers'
  17. %div
  18. = link_to admin_reports_path(account_id: @account.id) do
  19. .dashboard__counters__num= number_with_delimiter @account.reports.count
  20. .dashboard__counters__label= t '.created_reports'
  21. %div
  22. = link_to admin_reports_path(target_account_id: @account.id) do
  23. .dashboard__counters__num= number_with_delimiter @account.targeted_reports.count
  24. .dashboard__counters__label= t '.targeted_reports'
  25. %div
  26. %div
  27. .dashboard__counters__text
  28. - if @account.local? && @account.user.nil?
  29. %span.neutral= t('admin.accounts.deleted')
  30. - elsif @account.suspended?
  31. %span.red= t('admin.accounts.suspended')
  32. - elsif @account.silenced?
  33. %span.red= t('admin.accounts.silenced')
  34. - elsif @account.local? && @account.user&.disabled?
  35. %span.red= t('admin.accounts.disabled')
  36. - elsif @account.local? && !@account.user&.confirmed?
  37. %span.neutral= t('admin.accounts.confirming')
  38. - else
  39. %span.neutral= t('admin.accounts.no_limits_imposed')
  40. .dashboard__counters__label= t 'admin.accounts.login_status'
  41. - unless @account.local? && @account.user.nil?
  42. .table-wrapper
  43. %table.table.inline-table
  44. %tbody
  45. - if @account.local?
  46. - if @account.avatar?
  47. %tr
  48. %th= t('admin.accounts.avatar')
  49. %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)
  50. %td
  51. - if @account.header?
  52. %tr
  53. %th= t('admin.accounts.header')
  54. %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)
  55. %td
  56. %tr
  57. %th= t('admin.accounts.role')
  58. %td= t("admin.accounts.roles.#{@account.user&.role}")
  59. %td
  60. = 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)
  61. = 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)
  62. %tr
  63. %th= t('admin.accounts.email')
  64. %td= @account.user_email
  65. %td= table_link_to 'edit', t('admin.accounts.change_email.label'), admin_account_change_email_path(@account.id) if can?(:change_email, @account.user)
  66. - if @account.user_unconfirmed_email.present?
  67. %tr
  68. %th= t('admin.accounts.unconfirmed_email')
  69. %td= @account.user_unconfirmed_email
  70. %td
  71. %tr
  72. %th= t('admin.accounts.email_status')
  73. %td
  74. - if @account.user&.confirmed?
  75. = t('admin.accounts.confirmed')
  76. - else
  77. = t('admin.accounts.confirming')
  78. %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)
  79. %tr
  80. %th= t('admin.accounts.login_status')
  81. %td
  82. - if @account.user&.disabled?
  83. = t('admin.accounts.disabled')
  84. - else
  85. = t('admin.accounts.enabled')
  86. %td
  87. - if @account.user&.disabled?
  88. = table_link_to 'unlock', t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post if can?(:enable, @account.user)
  89. - else
  90. = table_link_to 'lock', t('admin.accounts.disable'), new_admin_account_action_path(@account.id, type: 'disable') if can?(:disable, @account.user)
  91. %tr
  92. %th= t('simple_form.labels.defaults.locale')
  93. %td= @account.user_locale
  94. %td
  95. %tr
  96. %th= t('admin.accounts.joined')
  97. %td
  98. %time.formatted{ datetime: @account.created_at.iso8601, title: l(@account.created_at) }= l @account.created_at
  99. %td
  100. %tr
  101. %th= t('admin.accounts.most_recent_ip')
  102. %td= @account.user_current_sign_in_ip
  103. %td
  104. %tr
  105. %th= t('admin.accounts.most_recent_activity')
  106. %td
  107. - if @account.user_current_sign_in_at
  108. %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
  109. - if @account.user&.invited?
  110. %tr
  111. %th= t('admin.accounts.invited_by')
  112. %td= admin_account_link_to @account.user.invite.user.account
  113. %td
  114. - else
  115. %tr
  116. %th= t('admin.accounts.inbox_url')
  117. %td
  118. = @account.inbox_url
  119. = fa_icon DeliveryFailureTracker.unavailable?(@account.inbox_url) ? 'times' : 'check'
  120. %tr
  121. %th= t('admin.accounts.shared_inbox_url')
  122. %td
  123. = @account.shared_inbox_url
  124. = fa_icon DeliveryFailureTracker.unavailable?(@account.shared_inbox_url) ? 'times' : 'check'
  125. %div{ style: 'overflow: hidden' }
  126. %div{ style: 'float: right' }
  127. - if @account.local?
  128. = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user)
  129. - if @account.user&.otp_required_for_login?
  130. = 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)
  131. - unless @account.memorial?
  132. = 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)
  133. - else
  134. = link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account)
  135. %div{ style: 'float: left' }
  136. - if @account.local?
  137. = link_to t('admin.accounts.warn'), new_admin_account_action_path(@account.id, type: 'none'), class: 'button' if can?(:warn, @account)
  138. - if @account.silenced?
  139. = link_to t('admin.accounts.undo_silenced'), unsilence_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsilence, @account)
  140. - else
  141. = link_to t('admin.accounts.silence'), new_admin_account_action_path(@account.id, type: 'silence'), class: 'button button--destructive' if can?(:silence, @account)
  142. - if @account.local?
  143. - unless @account.user_confirmed?
  144. = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
  145. - if @account.suspended?
  146. = link_to t('admin.accounts.undo_suspension'), unsuspend_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsuspend, @account)
  147. - else
  148. = 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)
  149. %hr.spacer/
  150. - unless @warnings.empty?
  151. = render @warnings
  152. %hr.spacer/
  153. = render @moderation_notes
  154. = simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
  155. = render 'shared/error_messages', object: @account_moderation_note
  156. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  157. = f.hidden_field :target_account_id
  158. .actions
  159. = f.button :button, t('admin.account_moderation_notes.create'), type: :submit