Gab Social. All are welcome.
This commit is contained in:
6
app/views/admin/reports/_action_log.html.haml
Normal file
6
app/views/admin/reports/_action_log.html.haml
Normal file
@@ -0,0 +1,6 @@
|
||||
.speech-bubble.positive
|
||||
.speech-bubble__bubble
|
||||
= t("admin.action_logs.actions.#{action_log.action}_#{action_log.target_type.underscore}", name: content_tag(:span, action_log.account.username, class: 'username'), target: content_tag(:span, log_target(action_log), class: 'target')).html_safe
|
||||
.speech-bubble__owner
|
||||
= admin_account_link_to(action_log.account)
|
||||
%time.formatted{ datetime: action_log.created_at.iso8601 }= l action_log.created_at
|
||||
34
app/views/admin/reports/_status.html.haml
Normal file
34
app/views/admin/reports/_status.html.haml
Normal file
@@ -0,0 +1,34 @@
|
||||
.batch-table__row
|
||||
%label.batch-table__row__select.batch-checkbox
|
||||
= f.check_box :status_ids, { multiple: true, include_hidden: false }, status.id
|
||||
.batch-table__row__content
|
||||
.status__content><
|
||||
- if status.proper.spoiler_text.blank?
|
||||
= Formatter.instance.format(status.proper, custom_emojify: true)
|
||||
- else
|
||||
%details<
|
||||
%summary><
|
||||
%strong> Content warning: #{Formatter.instance.format_spoiler(status.proper)}
|
||||
= Formatter.instance.format(status.proper, custom_emojify: true)
|
||||
|
||||
- unless status.proper.media_attachments.empty?
|
||||
- if status.proper.media_attachments.first.video?
|
||||
- video = status.proper.media_attachments.first
|
||||
= react_component :video, src: video.file.url(:original), preview: video.file.url(:small), sensitive: !current_account&.user&.show_all_media? && status.proper.sensitive? || current_account&.user&.hide_all_media?, width: 610, height: 343, inline: true, alt: video.description
|
||||
- else
|
||||
= react_component :media_gallery, height: 343, sensitive: !current_account&.user&.show_all_media? && status.sensitive? || current_account&.user&.hide_all_media?, 'autoPlayGif': current_account&.user&.setting_auto_play_gif, media: status.proper.media_attachments.map { |a| ActiveModelSerializers::SerializableResource.new(a, serializer: REST::MediaAttachmentSerializer).as_json }
|
||||
|
||||
.detailed-status__meta
|
||||
= link_to TagManager.instance.url_for(status), class: 'detailed-status__datetime', target: stream_link_target, rel: 'noopener' do
|
||||
%time.formatted{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
|
||||
·
|
||||
- if status.reblog?
|
||||
= fa_icon('retweet fw')
|
||||
= t('statuses.boosted_from_html', acct_link: admin_account_inline_link_to(status.proper.account))
|
||||
- else
|
||||
= fa_visibility_icon(status)
|
||||
= t("statuses.visibilities.#{status.visibility}")
|
||||
- if status.proper.sensitive?
|
||||
·
|
||||
= fa_icon('eye-slash fw')
|
||||
= t('stream_entries.sensitive_content')
|
||||
52
app/views/admin/reports/index.html.haml
Normal file
52
app/views/admin/reports/index.html.haml
Normal file
@@ -0,0 +1,52 @@
|
||||
- content_for :page_title do
|
||||
= t('admin.reports.title')
|
||||
|
||||
.filters
|
||||
.filter-subset
|
||||
%strong= t('admin.reports.status')
|
||||
%ul
|
||||
%li= filter_link_to t('admin.reports.unresolved'), resolved: nil
|
||||
%li= filter_link_to t('admin.reports.resolved'), resolved: '1'
|
||||
|
||||
- @reports.group_by(&:target_account_id).each do |target_account_id, reports|
|
||||
- target_account = reports.first.target_account
|
||||
.report-card
|
||||
.report-card__profile
|
||||
= account_link_to target_account, '', size: 36, path: admin_account_path(target_account.id)
|
||||
.report-card__profile__stats
|
||||
= link_to pluralize(target_account.targeted_moderation_notes.count, t('admin.reports.account.note')), admin_account_path(target_account.id)
|
||||
%br/
|
||||
- if target_account.suspended?
|
||||
%span.red= t('admin.accounts.suspended')
|
||||
- elsif target_account.silenced?
|
||||
%span.red= t('admin.accounts.silenced')
|
||||
- elsif target_account.user&.disabled?
|
||||
%span.red= t('admin.accounts.disabled')
|
||||
- else
|
||||
%span.neutral= t('admin.accounts.no_limits_imposed')
|
||||
.report-card__summary
|
||||
- reports.each do |report|
|
||||
.report-card__summary__item
|
||||
.report-card__summary__item__reported-by
|
||||
- if report.account.local?
|
||||
= admin_account_link_to report.account
|
||||
- else
|
||||
= report.account.domain
|
||||
.report-card__summary__item__content
|
||||
= link_to admin_report_path(report) do
|
||||
.one-line= report.comment.presence || t('admin.reports.comment.none')
|
||||
|
||||
%span.report-card__summary__item__content__icon{ title: t('admin.accounts.statuses') }
|
||||
= fa_icon('comment')
|
||||
= report.statuses.count
|
||||
|
||||
%span.report-card__summary__item__content__icon{ title: t('admin.accounts.media_attachments') }
|
||||
= fa_icon('camera')
|
||||
= report.media_attachments.count
|
||||
|
||||
.report-card__summary__item__assigned
|
||||
- if report.assigned_account.present?
|
||||
= admin_account_link_to report.assigned_account
|
||||
- else
|
||||
\-
|
||||
= paginate @reports
|
||||
123
app/views/admin/reports/show.html.haml
Normal file
123
app/views/admin/reports/show.html.haml
Normal file
@@ -0,0 +1,123 @@
|
||||
- content_for :header_tags do
|
||||
= javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous'
|
||||
|
||||
- content_for :page_title do
|
||||
= t('admin.reports.report', id: @report.id)
|
||||
|
||||
%div{ style: 'overflow: hidden; margin-bottom: 20px' }
|
||||
- if @report.unresolved?
|
||||
%div{ style: 'float: right' }
|
||||
- if @report.target_account.local?
|
||||
= link_to t('admin.accounts.warn'), new_admin_account_action_path(@report.target_account_id, type: 'none', report_id: @report.id), class: 'button'
|
||||
= link_to t('admin.accounts.disable'), new_admin_account_action_path(@report.target_account_id, type: 'disable', report_id: @report.id), class: 'button button--destructive'
|
||||
= link_to t('admin.accounts.silence'), new_admin_account_action_path(@report.target_account_id, type: 'silence', report_id: @report.id), class: 'button button--destructive'
|
||||
= link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@report.target_account_id, type: 'suspend', report_id: @report.id), class: 'button button--destructive'
|
||||
%div{ style: 'float: left' }
|
||||
= link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button'
|
||||
- else
|
||||
= link_to t('admin.reports.mark_as_unresolved'), reopen_admin_report_path(@report), method: :post, class: 'button'
|
||||
|
||||
%hr.spacer
|
||||
|
||||
.table-wrapper
|
||||
%table.table.inline-table
|
||||
%tbody
|
||||
%tr
|
||||
%th= t('admin.reports.reported_account')
|
||||
%td= admin_account_link_to @report.target_account
|
||||
%td= table_link_to 'flag', pluralize(@report.target_account.targeted_reports.count, t('admin.reports.account.report')), admin_reports_path(target_account_id: @report.target_account.id)
|
||||
%td= table_link_to 'file', pluralize(@report.target_account.targeted_moderation_notes.count, t('admin.reports.account.note')), admin_reports_path(target_account_id: @report.target_account.id)
|
||||
%tr
|
||||
%th= t('admin.reports.reported_by')
|
||||
- if @report.account.local?
|
||||
%td= admin_account_link_to @report.account
|
||||
%td= table_link_to 'flag', pluralize(@report.account.targeted_reports.count, t('admin.reports.account.report')), admin_reports_path(target_account_id: @report.account.id)
|
||||
%td= table_link_to 'file', pluralize(@report.account.targeted_moderation_notes.count, t('admin.reports.account.note')), admin_reports_path(target_account_id: @report.account.id)
|
||||
- else
|
||||
%td{ colspan: 3 }= @report.account.domain
|
||||
%tr
|
||||
%th= t('admin.reports.created_at')
|
||||
%td{ colspan: 3 }
|
||||
%time.formatted{ datetime: @report.created_at.iso8601 }
|
||||
%tr
|
||||
%th= t('admin.reports.updated_at')
|
||||
%td{ colspan: 3 }
|
||||
%time.formatted{ datetime: @report.updated_at.iso8601 }
|
||||
%tr
|
||||
%th= t('admin.reports.status')
|
||||
%td
|
||||
- if @report.action_taken?
|
||||
= t('admin.reports.resolved')
|
||||
- else
|
||||
= t('admin.reports.unresolved')
|
||||
%td{ colspan: 2 }
|
||||
- if @report.action_taken?
|
||||
= table_link_to 'envelope-open', t('admin.reports.reopen'), admin_report_path(@report, outcome: 'reopen'), method: :put
|
||||
- if !@report.action_taken_by_account.nil?
|
||||
%tr
|
||||
%th= t('admin.reports.action_taken_by')
|
||||
%td{ colspan: 3 }
|
||||
= admin_account_link_to @report.action_taken_by_account
|
||||
- else
|
||||
%tr
|
||||
%th= t('admin.reports.assigned')
|
||||
%td
|
||||
- if @report.assigned_account.nil?
|
||||
\-
|
||||
- else
|
||||
= admin_account_link_to @report.assigned_account
|
||||
%td
|
||||
- if @report.assigned_account != current_user.account
|
||||
= table_link_to 'user', t('admin.reports.assign_to_self'), assign_to_self_admin_report_path(@report), method: :post
|
||||
%td
|
||||
- if !@report.assigned_account.nil?
|
||||
= table_link_to 'trash', t('admin.reports.unassign'), unassign_admin_report_path(@report), method: :post
|
||||
|
||||
%hr.spacer
|
||||
|
||||
.speech-bubble
|
||||
.speech-bubble__bubble= simple_format(@report.comment.presence || t('admin.reports.comment.none'))
|
||||
.speech-bubble__owner
|
||||
- if @report.account.local?
|
||||
= admin_account_link_to @report.account
|
||||
- else
|
||||
= @report.account.domain
|
||||
%br/
|
||||
%time.formatted{ datetime: @report.created_at.iso8601 }
|
||||
|
||||
- unless @report.statuses.empty?
|
||||
%hr.spacer/
|
||||
|
||||
= form_for(@form, url: admin_report_reported_statuses_path(@report.id)) do |f|
|
||||
.batch-table
|
||||
.batch-table__toolbar
|
||||
%label.batch-table__toolbar__select.batch-checkbox-all
|
||||
= check_box_tag :batch_checkbox_all, nil, false
|
||||
.batch-table__toolbar__actions
|
||||
= f.button safe_join([fa_icon('eye-slash'), t('admin.statuses.batch.nsfw_on')]), name: :nsfw_on, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
||||
= f.button safe_join([fa_icon('eye'), t('admin.statuses.batch.nsfw_off')]), name: :nsfw_off, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
||||
= f.button safe_join([fa_icon('trash'), t('admin.statuses.batch.delete')]), name: :delete, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
|
||||
.batch-table__body
|
||||
= render partial: 'admin/reports/status', collection: @report.statuses, locals: { f: f }
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
- @report_notes.each do |item|
|
||||
- if item.is_a?(Admin::ActionLog)
|
||||
= render partial: 'action_log', locals: { action_log: item }
|
||||
- else
|
||||
= render item
|
||||
|
||||
= simple_form_for @report_note, url: admin_report_notes_path do |f|
|
||||
= render 'shared/error_messages', object: @report_note
|
||||
= f.input :report_id, as: :hidden
|
||||
|
||||
.field-group
|
||||
= f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
|
||||
|
||||
.actions
|
||||
- if @report.unresolved?
|
||||
= f.button :button, t('admin.reports.notes.create_and_resolve'), name: :create_and_resolve, type: :submit
|
||||
- else
|
||||
= f.button :button, t('admin.reports.notes.create_and_unresolve'), name: :create_and_unresolve, type: :submit
|
||||
= f.button :button, t('admin.reports.notes.create'), type: :submit
|
||||
Reference in New Issue
Block a user