where i deviate from standard mastodon assets
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.

show.html.haml 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. - content_for :page_title do
  2. = @account.acct
  3. = render 'application/card', account: @account
  4. - account = @account
  5. - proofs = account.identity_proofs.active
  6. - fields = account.fields
  7. - unless fields.empty? && proofs.empty? && account.note.blank?
  8. .admin-account-bio
  9. - unless fields.empty? && proofs.empty?
  10. %div
  11. .account__header__fields
  12. - proofs.each do |proof|
  13. %dl
  14. %dt= proof.provider.capitalize
  15. %dd.verified
  16. = link_to fa_icon('check'), proof.badge.proof_url, class: 'verified__mark', title: t('accounts.link_verified_on', date: l(proof.updated_at))
  17. = link_to proof.provider_username, proof.badge.profile_url
  18. - fields.each do |field|
  19. %dl
  20. %dt.emojify{ title: field.name }= Formatter.instance.format_field(account, field.name, custom_emojify: true)
  21. %dd{ title: field.value, class: custom_field_classes(field) }
  22. - if field.verified?
  23. %span.verified__mark{ title: t('accounts.link_verified_on', date: l(field.verified_at)) }
  24. = fa_icon 'check'
  25. = Formatter.instance.format_field(account, field.value, custom_emojify: true)
  26. - if account.note.present?
  27. %div
  28. .account__header__content.emojify= Formatter.instance.simplified_format(account, custom_emojify: true)
  29. .dashboard__counters{ style: 'margin-top: 10px' }
  30. %div
  31. = link_to admin_account_statuses_path(@account.id) do
  32. .dashboard__counters__num= number_with_delimiter @account.statuses_count
  33. .dashboard__counters__label= t 'admin.accounts.statuses'
  34. %div
  35. = link_to admin_account_statuses_path(@account.id, { media: true }) do
  36. .dashboard__counters__num= number_to_human_size @account.media_attachments.sum('file_file_size')
  37. .dashboard__counters__label= t 'admin.accounts.media_attachments'
  38. %div
  39. = link_to admin_account_followers_path(@account.id) do
  40. .dashboard__counters__num= number_with_delimiter @account.local_followers_count
  41. .dashboard__counters__label= t 'admin.accounts.followers'
  42. %div
  43. = link_to admin_reports_path(account_id: @account.id) do
  44. .dashboard__counters__num= number_with_delimiter @account.reports.count
  45. .dashboard__counters__label= t '.created_reports'
  46. %div
  47. = link_to admin_reports_path(target_account_id: @account.id) do
  48. .dashboard__counters__num= number_with_delimiter @account.targeted_reports.count
  49. .dashboard__counters__label= t '.targeted_reports'
  50. %div
  51. %div
  52. .dashboard__counters__text
  53. - if @account.local? && @account.user.nil?
  54. %span.neutral= t('admin.accounts.deleted')
  55. - elsif @account.suspended?
  56. %span.red= t('admin.accounts.suspended')
  57. - elsif @account.silenced?
  58. %span.red= t('admin.accounts.silenced')
  59. - elsif @account.local? && @account.user&.disabled?
  60. %span.red= t('admin.accounts.disabled')
  61. - elsif @account.local? && !@account.user&.confirmed?
  62. %span.neutral= t('admin.accounts.confirming')
  63. - elsif @account.local? && !@account.user_approved?
  64. %span.neutral= t('admin.accounts.pending')
  65. - else
  66. %span.neutral= t('admin.accounts.no_limits_imposed')
  67. .dashboard__counters__label= t 'admin.accounts.login_status'
  68. - unless @account.local? && @account.user.nil?
  69. .table-wrapper
  70. %table.table.inline-table
  71. %tbody
  72. - if @account.local?
  73. - if @account.avatar?
  74. %tr
  75. %th= t('admin.accounts.avatar')
  76. %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)
  77. %td
  78. - if @account.header?
  79. %tr
  80. %th= t('admin.accounts.header')
  81. %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)
  82. %td
  83. %tr
  84. %th= t('admin.accounts.role')
  85. %td= t("admin.accounts.roles.#{@account.user&.role}")
  86. %td
  87. = 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)
  88. = 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)
  89. %tr
  90. %th= t('admin.accounts.email')
  91. %td= @account.user_email
  92. %td= table_link_to 'edit', t('admin.accounts.change_email.label'), admin_account_change_email_path(@account.id) if can?(:change_email, @account.user)
  93. - if @account.user_unconfirmed_email.present?
  94. %tr
  95. %th= t('admin.accounts.unconfirmed_email')
  96. %td= @account.user_unconfirmed_email
  97. %td
  98. %tr
  99. %th= t('admin.accounts.email_status')
  100. %td
  101. - if @account.user&.confirmed?
  102. = t('admin.accounts.confirmed')
  103. - else
  104. = t('admin.accounts.confirming')
  105. %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)
  106. %tr
  107. %th= t('admin.accounts.login_status')
  108. %td
  109. - if @account.user&.disabled?
  110. = t('admin.accounts.disabled')
  111. - else
  112. = t('admin.accounts.enabled')
  113. %td
  114. - if @account.user&.disabled?
  115. = table_link_to 'unlock', t('admin.accounts.enable'), enable_admin_account_path(@account.id), method: :post if can?(:enable, @account.user)
  116. - elsif @account.user_approved?
  117. = table_link_to 'lock', t('admin.accounts.disable'), new_admin_account_action_path(@account.id, type: 'disable') if can?(:disable, @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.unavailable?(@account.inbox_url) ? 'times' : 'check'
  150. %tr
  151. %th= t('admin.accounts.shared_inbox_url')
  152. %td
  153. = @account.shared_inbox_url
  154. = fa_icon DeliveryFailureTracker.unavailable?(@account.shared_inbox_url) ? 'times' : 'check'
  155. %div{ style: 'overflow: hidden' }
  156. %div{ style: 'float: right' }
  157. - if @account.local?
  158. = link_to t('admin.accounts.reset_password'), admin_account_reset_path(@account.id), method: :create, class: 'button' if can?(:reset_password, @account.user)
  159. - if @account.user&.otp_required_for_login?
  160. = 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)
  161. - if !@account.memorial? && @account.user_approved?
  162. = 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)
  163. - else
  164. = link_to t('admin.accounts.redownload'), redownload_admin_account_path(@account.id), method: :post, class: 'button' if can?(:redownload, @account)
  165. %div{ style: 'float: left' }
  166. - if @account.local? && @account.user_approved?
  167. = link_to t('admin.accounts.warn'), new_admin_account_action_path(@account.id, type: 'none'), class: 'button' if can?(:warn, @account)
  168. - if @account.silenced?
  169. = link_to t('admin.accounts.undo_silenced'), unsilence_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsilence, @account)
  170. - elsif !@account.local? || @account.user_approved?
  171. = link_to t('admin.accounts.silence'), new_admin_account_action_path(@account.id, type: 'silence'), class: 'button button--destructive' if can?(:silence, @account)
  172. - if @account.local?
  173. - if @account.user_pending?
  174. = 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)
  175. = 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)
  176. - unless @account.user_confirmed?
  177. = link_to t('admin.accounts.confirm'), admin_account_confirmation_path(@account.id), method: :post, class: 'button' if can?(:confirm, @account.user)
  178. - if @account.suspended?
  179. = link_to t('admin.accounts.undo_suspension'), unsuspend_admin_account_path(@account.id), method: :post, class: 'button' if can?(:unsuspend, @account)
  180. - elsif !@account.local? || @account.user_approved?
  181. = 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)
  182. - unless @account.local?
  183. - if DomainBlock.where(domain: @account.domain).exists?
  184. = link_to t('admin.domain_blocks.view'), admin_instance_path(@account.domain), class: 'button'
  185. - else
  186. = link_to t('admin.domain_blocks.add_new'), new_admin_domain_block_path(_domain: @account.domain), class: 'button button--destructive'
  187. %hr.spacer/
  188. - unless @warnings.empty?
  189. = render @warnings
  190. %hr.spacer/
  191. = render @moderation_notes
  192. = simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
  193. = render 'shared/error_messages', object: @account_moderation_note
  194. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  195. = f.hidden_field :target_account_id
  196. .actions
  197. = f.button :button, t('admin.account_moderation_notes.create'), type: :submit