show.html.haml 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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. - elsif @account.local? && !@account.user_approved?
  39. %span.neutral= t('admin.accounts.pending')
  40. - else
  41. %span.neutral= t('admin.accounts.no_limits_imposed')
  42. .dashboard__counters__label= t 'admin.accounts.login_status'
  43. - unless @account.local? && @account.user.nil?
  44. .table-wrapper
  45. %table.table.inline-table
  46. %tbody
  47. - if @account.local?
  48. - if @account.avatar?
  49. %tr
  50. %th= t('admin.accounts.avatar')
  51. %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)
  52. %td
  53. - if @account.header?
  54. %tr
  55. %th= t('admin.accounts.header')
  56. %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)
  57. %td
  58. %tr
  59. %th= t('admin.accounts.role')
  60. %td= t("admin.accounts.roles.#{@account.user&.role}")
  61. %td
  62. = 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)
  63. = 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)
  64. %tr
  65. %th= t('admin.accounts.email')
  66. %td= @account.user_email
  67. %td= table_link_to 'edit', t('admin.accounts.change_email.label'), admin_account_change_email_path(@account.id) if can?(:change_email, @account.user)
  68. - if @account.user_unconfirmed_email.present?
  69. %tr
  70. %th= t('admin.accounts.unconfirmed_email')
  71. %td= @account.user_unconfirmed_email
  72. %td
  73. %tr
  74. %th= t('admin.accounts.email_status')
  75. %td
  76. - if @account.user&.confirmed?
  77. = t('admin.accounts.confirmed')
  78. - else
  79. = t('admin.accounts.confirming')
  80. %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)
  81. %tr
  82. %th= t('admin.accounts.login_status')
  83. %td
  84. - if @account.user&.disabled?
  85. = t('admin.accounts.disabled')
  86. - else
  87. = t('admin.accounts.enabled')
  88. %td
  89. - if @account.user&.disabled?
  90. = table_link_to 'unlock', t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post if can?(:enable, @account.user)
  91. - elsif @account.user_approved?
  92. = table_link_to 'lock', t('admin.accounts.disable'), new_admin_account_action_path(@account.id, type: 'disable') if can?(:disable, @account.user)
  93. %tr
  94. %th= t('simple_form.labels.defaults.locale')
  95. %td= @account.user_locale
  96. %td
  97. %tr
  98. %th= t('admin.accounts.joined')
  99. %td
  100. %time.formatted{ datetime: @account.created_at.iso8601, title: l(@account.created_at) }= l @account.created_at
  101. %td
  102. %tr
  103. %th= t('admin.accounts.most_recent_ip')
  104. %td= @account.user_current_sign_in_ip
  105. %td
  106. %tr
  107. %th= t('admin.accounts.most_recent_activity')
  108. %td
  109. - if @account.user_current_sign_in_at
  110. %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
  111. - if @account.user&.invited?
  112. %tr
  113. %th= t('admin.accounts.invited_by')
  114. %td= admin_account_link_to @account.user.invite.user.account
  115. %td
  116. - else
  117. %tr
  118. %th= t('admin.accounts.inbox_url')
  119. %td
  120. = @account.inbox_url
  121. = fa_icon DeliveryFailureTracker.unavailable?(@account.inbox_url) ? 'times' : 'check'
  122. %tr
  123. %th= t('admin.accounts.shared_inbox_url')
  124. %td
  125. = @account.shared_inbox_url
  126. = fa_icon DeliveryFailureTracker.unavailable?(@account.shared_inbox_url) ? 'times' : 'check'
  127. %div{ style: 'overflow: hidden' }
  128. %div{ style: 'float: right' }
  129. - if @account.local?
  130. = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user)
  131. - if @account.user&.otp_required_for_login?
  132. = 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)
  133. - if !@account.memorial? && @account.user_approved?
  134. = 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)
  135. - else
  136. = link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account)
  137. %div{ style: 'float: left' }
  138. - if @account.local? && @account.user_approved?
  139. = link_to t('admin.accounts.warn'), new_admin_account_action_path(@account.id, type: 'none'), class: 'button' if can?(:warn, @account)
  140. - if @account.silenced?
  141. = link_to t('admin.accounts.undo_silenced'), unsilence_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsilence, @account)
  142. - elsif !@account.local? || @account.user_approved?
  143. = link_to t('admin.accounts.silence'), new_admin_account_action_path(@account.id, type: 'silence'), class: 'button button--destructive' if can?(:silence, @account)
  144. - if @account.local?
  145. - if @account.user_pending?
  146. = 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)
  147. = 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)
  148. - unless @account.user_confirmed?
  149. = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
  150. - if @account.suspended?
  151. = link_to t('admin.accounts.undo_suspension'), unsuspend_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsuspend, @account)
  152. - elsif !@account.local? || @account.user_approved?
  153. = 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)
  154. - unless @account.local?
  155. - if DomainBlock.where(domain: @account.domain).exists?
  156. = link_to t('admin.domain_blocks.undo'), admin_instance_path(@account.domain), class: 'button'
  157. - else
  158. = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path(_domain: @account.domain), class: 'button button--destructive'
  159. %hr.spacer/
  160. - unless @warnings.empty?
  161. = render @warnings
  162. %hr.spacer/
  163. = render @moderation_notes
  164. = simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
  165. = render 'shared/error_messages', object: @account_moderation_note
  166. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  167. = f.hidden_field :target_account_id
  168. .actions
  169. = f.button :button, t('admin.account_moderation_notes.create'), type: :submit