Improve Report Notes and Account Moderation Notes (#30288)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
#
|
||||
|
||||
class AccountModerationNote < ApplicationRecord
|
||||
CONTENT_SIZE_LIMIT = 500
|
||||
CONTENT_SIZE_LIMIT = 2_000
|
||||
|
||||
belongs_to :account
|
||||
belongs_to :target_account, class_name: 'Account'
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#
|
||||
|
||||
class ReportNote < ApplicationRecord
|
||||
CONTENT_SIZE_LIMIT = 500
|
||||
CONTENT_SIZE_LIMIT = 2_000
|
||||
|
||||
belongs_to :account
|
||||
belongs_to :report, inverse_of: :notes, touch: true
|
||||
|
||||
@@ -62,14 +62,16 @@
|
||||
.report-notes
|
||||
= render partial: 'admin/report_notes/report_note', collection: @moderation_notes
|
||||
|
||||
= simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |f|
|
||||
= f.hidden_field :target_account_id
|
||||
= simple_form_for @account_moderation_note, url: admin_account_moderation_notes_path do |form|
|
||||
= form.hidden_field :target_account_id
|
||||
|
||||
= render 'shared/error_messages', object: @account_moderation_note
|
||||
|
||||
.field-group
|
||||
= f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
|
||||
= form.input :content, input_html: { placeholder: t('admin.reports.notes.placeholder'), maxlength: AccountModerationNote::CONTENT_SIZE_LIMIT, rows: 6, autofocus: @account_moderation_note.errors.any? }
|
||||
|
||||
.actions
|
||||
= f.button :button, t('admin.account_moderation_notes.create'), type: :submit
|
||||
= form.button :button, t('admin.account_moderation_notes.create'), type: :submit
|
||||
|
||||
%hr.spacer/
|
||||
|
||||
|
||||
@@ -83,15 +83,17 @@
|
||||
.report-notes
|
||||
= render @report_notes
|
||||
|
||||
= simple_form_for @report_note, url: admin_report_notes_path do |f|
|
||||
= f.input :report_id, as: :hidden
|
||||
= 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
|
||||
= f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
|
||||
= 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?
|
||||
= f.button :button, t('admin.reports.notes.create_and_resolve'), name: :create_and_resolve, type: :submit
|
||||
= form.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
|
||||
= 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
|
||||
|
||||
Reference in New Issue
Block a user