summaryrefslogtreecommitdiffstats
path: root/app/views/admin/reports/show.html.haml
blob: ca1edea0fe31481c22435e13d81c7673ff87061b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
- content_for :page_title do
  = t('admin.reports.report', id: @report.id)

- content_for :heading_actions do
  - if @report.unresolved?
    = 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'

- unless @report.account.local? || @report.target_account.local?
  .flash-message= t('admin.reports.forwarded_replies_explanation')

.report-header
  = render 'admin/reports/header_card', report: @report
  = render 'admin/reports/header_details', report: @report

%hr.spacer

%h3= t 'admin.reports.category'

%p= t 'admin.reports.category_description_html'

= react_admin_component :report_reason_selector,
                        category: @report.category,
                        disabled: @report.action_taken?,
                        id: @report.id,
                        rule_ids: @report.rule_ids&.map(&:to_s)

- if @report.comment.present?
  = render 'admin/reports/comment', report: @report

%hr.spacer/

%h3
  = t 'admin.reports.statuses'
  %small.section-skip-link
    = link_to '#actions' do
      = fa_icon 'angle-double-down'
      = t('admin.reports.skip_to_actions')

%p
  = t 'admin.reports.statuses_description_html'
    = link_to safe_join([material_symbol('add'), t('admin.reports.add_to_report')]),
            admin_account_statuses_path(@report.target_account_id, report_id: @report.id),
            class: 'table-action-link'

= form_with model: @form, url: batch_admin_account_statuses_path(@report.target_account_id, report_id: @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
        - if !@statuses.empty? && @report.unresolved?
          = f.button safe_join([material_symbol('close'), t('admin.statuses.batch.remove_from_report')]), name: :remove_from_report, class: 'table-action-link', type: :submit
    .batch-table__body
      - if @statuses.empty?
        = nothing_here 'nothing-here--under-tabs'
      - else
        = render partial: 'admin/reports/status', collection: @statuses, locals: { f: f }

- if @report.unresolved?
  %hr.spacer/

  %p#actions= t(@report.target_account.local? ? 'admin.reports.actions_description_html' : 'admin.reports.actions_description_remote_html')

  = render partial: 'admin/reports/actions', locals: { report: @report, statuses: @statuses }

- unless @action_logs.empty?
  %hr.spacer/

  %h3= t 'admin.reports.action_log'

  .report-notes
    = render @action_logs

%hr.spacer/

%h3= t 'admin.reports.notes.title'

%p= t 'admin.reports.notes_description_html'

.report-notes
  = render @report_notes

= simple_form_for @report_note, url: admin_report_notes_path do |form|
  = form.input :report_id, as: :hidden

  = render 'shared/error_messages', object: @report_note

  .field-group
    = form.input :content, input_html: { placeholder: t('admin.reports.notes.placeholder'), maxlength: ReportNote::CONTENT_SIZE_LIMIT, rows: 6, autofocus: @report_note.errors.any? }

  .actions
    - if @report.unresolved?
      = form.button :button, t('admin.reports.notes.create_and_resolve'), name: :create_and_resolve, type: :submit
    - else
      = form.button :button, t('admin.reports.notes.create_and_unresolve'), name: :create_and_unresolve, type: :submit
    = form.button :button, t('admin.reports.notes.create'), type: :submit