]> cat aescling's git repositories - mastodon.git/commit
Add moderation warnings (#9519)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 22 Dec 2018 19:02:09 +0000 (20:02 +0100)
committerGitHub <noreply@github.com>
Sat, 22 Dec 2018 19:02:09 +0000 (20:02 +0100)
commit3c033c4352f8b156887cd7157b4a89c23a545838
treefa6317223a0104abea84a10e6234a0beef316001
parent00862dcaff7cb918d29947accda1c01873a7ddeb
Add moderation warnings (#9519)

* Add moderation warnings

Replace individual routes for disabling, silencing, and suspending
a user, as well as the report update route, with a unified account
action controller that allows you to select an action (none,
disable, silence, suspend) as well as whether it should generate an
e-mail notification with optional custom text. That notification,
with the optional custom text, is saved as a warning.

Additionally, there are warning presets you can configure to save
time when performing the above.

* Use Account#local_username_and_domain
72 files changed:
app/controllers/admin/account_actions_controller.rb [new file with mode: 0644]
app/controllers/admin/account_moderation_notes_controller.rb
app/controllers/admin/accounts_controller.rb
app/controllers/admin/reports_controller.rb
app/controllers/admin/silences_controller.rb [deleted file]
app/controllers/admin/suspensions_controller.rb [deleted file]
app/controllers/admin/warning_presets_controller.rb [new file with mode: 0644]
app/helpers/admin/action_logs_helper.rb
app/javascript/images/icon_flag.svg [new file with mode: 0644]
app/javascript/images/mailer/icon_warning.png [new file with mode: 0644]
app/javascript/styles/mailer.scss
app/javascript/styles/mastodon/admin.scss
app/mailers/user_mailer.rb
app/models/account.rb
app/models/account_warning.rb [new file with mode: 0644]
app/models/account_warning_preset.rb [new file with mode: 0644]
app/models/admin/account_action.rb [new file with mode: 0644]
app/models/concerns/account_associations.rb
app/models/form/admin_suspension_confirmation.rb [deleted file]
app/policies/account_policy.rb
app/policies/account_warning_preset_policy.rb [new file with mode: 0644]
app/views/admin/account_actions/new.html.haml [new file with mode: 0644]
app/views/admin/account_warnings/_account_warning.html.haml [new file with mode: 0644]
app/views/admin/accounts/show.html.haml
app/views/admin/reports/show.html.haml
app/views/admin/suspensions/new.html.haml [deleted file]
app/views/admin/warning_presets/edit.html.haml [new file with mode: 0644]
app/views/admin/warning_presets/index.html.haml [new file with mode: 0644]
app/views/user_mailer/warning.html.haml [new file with mode: 0644]
app/views/user_mailer/warning.text.erb [new file with mode: 0644]
app/views/user_mailer/welcome.text.erb
config/locales/ar.yml
config/locales/ast.yml
config/locales/ca.yml
config/locales/co.yml
config/locales/cs.yml
config/locales/cy.yml
config/locales/da.yml
config/locales/de.yml
config/locales/el.yml
config/locales/en.yml
config/locales/eo.yml
config/locales/es.yml
config/locales/eu.yml
config/locales/fa.yml
config/locales/fr.yml
config/locales/gl.yml
config/locales/it.yml
config/locales/ja.yml
config/locales/ko.yml
config/locales/nl.yml
config/locales/oc.yml
config/locales/pl.yml
config/locales/pt-BR.yml
config/locales/ru.yml
config/locales/simple_form.en.yml
config/locales/sk.yml
config/locales/sr.yml
config/routes.rb
db/migrate/20181213184704_create_account_warnings.rb [new file with mode: 0644]
db/migrate/20181213185533_create_account_warning_presets.rb [new file with mode: 0644]
db/schema.rb
spec/controllers/admin/accounts_controller_spec.rb
spec/controllers/admin/reports_controller_spec.rb
spec/controllers/admin/silences_controller_spec.rb [deleted file]
spec/controllers/admin/suspensions_controller_spec.rb [deleted file]
spec/fabricators/account_warning_fabricator.rb [new file with mode: 0644]
spec/fabricators/account_warning_preset_fabricator.rb [new file with mode: 0644]
spec/mailers/previews/user_mailer_preview.rb
spec/models/account_warning_preset_spec.rb [new file with mode: 0644]
spec/models/account_warning_spec.rb [new file with mode: 0644]
spec/models/admin/account_action_spec.rb [new file with mode: 0644]