Feature: Improve reports ui (#7032)
* Further improvements to Reports UI - Clean up notes display - Clean up add new note form - Simplify controller - Allow reopening a report with a note - Show created at date for reports - Fix report details table formatting * Show history of report using Admin::ActionLog beneath the report * Fix incorrect log message when reopening a report * Implement fetching of all ActionLog items that could be related to the report * Ensure adding a report_note updates the report's updated_at * Limit Report History to actions that happened between the report being created and the report being resolved * Fix linting issues * Improve report history builder Thanks @gargron for the improvements
This commit is contained in:
committed by
Eugen Rochko
parent
45c9f16f71
commit
d9b62e34da
@ -1,11 +1,9 @@
|
||||
%tr
|
||||
%td
|
||||
%p
|
||||
%strong= report_note.account.acct
|
||||
on
|
||||
%li
|
||||
%h4
|
||||
= report_note.account.acct
|
||||
%div{ style: 'float: right' }
|
||||
%time.formatted{ datetime: report_note.created_at.iso8601, title: l(report_note.created_at) }
|
||||
= l report_note.created_at
|
||||
= table_link_to 'trash', t('admin.reports.notes.delete'), admin_report_note_path(report_note), method: :delete if can?(:destroy, report_note)
|
||||
%br/
|
||||
%br/
|
||||
%div{ class: 'report-note__comment' }
|
||||
= simple_format(h(report_note.content))
|
||||
|
@ -5,7 +5,7 @@
|
||||
= t('admin.reports.report', id: @report.id)
|
||||
|
||||
%div{ style: 'overflow: hidden; margin-bottom: 20px' }
|
||||
- if !@report.action_taken?
|
||||
- if @report.unresolved?
|
||||
%div{ style: 'float: right' }
|
||||
= link_to t('admin.reports.silence_account'), admin_report_path(@report, outcome: 'silence'), method: :put, class: 'button'
|
||||
= link_to t('admin.reports.suspend_account'), admin_report_path(@report, outcome: 'suspend'), method: :put, class: 'button'
|
||||
@ -17,22 +17,29 @@
|
||||
.table-wrapper
|
||||
%table.table.inline-table
|
||||
%tbody
|
||||
%tr
|
||||
%th= t('admin.reports.created_at')
|
||||
%td{colspan: 2}
|
||||
%time.formatted{ datetime: @report.created_at.iso8601 }
|
||||
%tr
|
||||
%th= t('admin.reports.updated_at')
|
||||
%td{colspan: 2}
|
||||
%time.formatted{ datetime: @report.updated_at.iso8601 }
|
||||
%tr
|
||||
%th= t('admin.reports.status')
|
||||
%td{colspan: 2}
|
||||
%td
|
||||
- if @report.action_taken?
|
||||
= t('admin.reports.resolved')
|
||||
= table_link_to 'envelope-open', t('admin.reports.reopen'), admin_report_path(@report, outcome: 'reopen'), method: :put
|
||||
- else
|
||||
= t('admin.reports.unresolved')
|
||||
%td{style: "text-align: right; overflow: hidden;"}
|
||||
- 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= @report.action_taken_by_account.acct
|
||||
%td{colspan: 2}
|
||||
= @report.action_taken_by_account.acct
|
||||
- else
|
||||
%tr
|
||||
%th= t('admin.reports.assigned')
|
||||
@ -47,6 +54,8 @@
|
||||
- if !@report.assigned_account.nil?
|
||||
= table_link_to 'trash', t('admin.reports.unassign'), admin_report_path(@report, outcome: 'unassign'), method: :put
|
||||
|
||||
%hr{ class: "section-break"}/
|
||||
|
||||
.report-accounts
|
||||
.report-accounts__item
|
||||
%h3= t('admin.reports.reported_account')
|
||||
@ -88,22 +97,28 @@
|
||||
= link_to admin_report_reported_status_path(@report, status), method: :delete, class: 'icon-button trash-button', title: t('admin.reports.delete'), data: { confirm: t('admin.reports.are_you_sure') }, remote: true do
|
||||
= fa_icon 'trash'
|
||||
|
||||
%hr/
|
||||
%hr{ class: "section-break"}/
|
||||
|
||||
%h3= t('admin.reports.notes.label')
|
||||
|
||||
- if @report_notes.length > 0
|
||||
.table-wrapper
|
||||
%table.table
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%tbody
|
||||
= render @report_notes
|
||||
%ul
|
||||
= render @report_notes
|
||||
|
||||
= simple_form_for @report_note, url: admin_report_notes_path do |f|
|
||||
%h4= t('admin.reports.notes.new_label')
|
||||
= form_for @report_note, url: admin_report_notes_path, html: { class: 'report-note__form' } do |f|
|
||||
= render 'shared/error_messages', object: @report_note
|
||||
= f.input :content
|
||||
= f.text_area :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6, class: 'report-note__textarea'
|
||||
= f.hidden_field :report_id
|
||||
= f.button :button, t('admin.reports.notes.create'), type: :submit
|
||||
= f.button :button, t('admin.reports.notes.create_and_resolve'), type: :submit, name: :create_and_resolve
|
||||
%div{ class: 'report-note__buttons' }
|
||||
- if @report.unresolved?
|
||||
= f.submit t('admin.reports.notes.create_and_resolve'), name: :create_and_resolve, class: 'button report-note__button'
|
||||
- else
|
||||
= f.submit t('admin.reports.notes.create_and_unresolve'), name: :create_and_unresolve, class: 'button report-note__button'
|
||||
= f.submit t('admin.reports.notes.create'), class: 'button report-note__button'
|
||||
|
||||
- if @report_history.length > 0
|
||||
%h3= t('admin.reports.history')
|
||||
|
||||
%ul
|
||||
= render @report_history
|
||||
|
Reference in New Issue
Block a user