2024-03-04 17:47:20 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module ModerationConcern
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
private
|
|
|
|
|
|
|
|
def redirect_to_moderation_queue!
|
|
|
|
redirect_back fallback_location: site_moderation_queue_path(**(session[:moderation_queue_filters] || {}))
|
|
|
|
end
|
2024-03-05 17:18:06 +00:00
|
|
|
|
|
|
|
# @return [String]
|
|
|
|
def panel_actor_mention
|
|
|
|
@panel_actor_mention ||= ENV.fetch('PANEL_ACTOR_MENTION', '@sutty@sutty.nl')
|
|
|
|
end
|
|
|
|
|
|
|
|
def remote_flag_params(model)
|
2024-03-05 18:46:33 +00:00
|
|
|
{ remote_flag_attributes: { id: model.remote_flag_id, message: ''.dup } }.tap do |p|
|
2024-03-05 17:18:06 +00:00
|
|
|
p[:remote_flag_attributes][:site_id] = model.site_id
|
|
|
|
p[:remote_flag_attributes][:actor_id] = model.actor_id
|
|
|
|
|
|
|
|
I18n.available_locales.each do |locale|
|
|
|
|
p[:remote_flag_attributes][:message].tap do |m|
|
|
|
|
m << I18n.t(locale)
|
|
|
|
m << ': '
|
|
|
|
m << I18n.t('remote_flags.report_message', locale: locale, panel_actor_mention: panel_actor_mention)
|
|
|
|
m << '\n\n'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2024-03-04 17:47:20 +00:00
|
|
|
end
|
|
|
|
end
|