5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 23:06:21 +00:00

feat: ser más informative con los comentarios

This commit is contained in:
f 2024-03-08 15:18:19 -03:00
parent cb30a3d02c
commit 8faa6d8ea8
No known key found for this signature in database
3 changed files with 41 additions and 0 deletions

View file

@ -11,6 +11,12 @@ class ActivityPubsController < ApplicationController
activity_pub.update(remote_flag_params(activity_pub)) if event == :report
activity_pub.public_send(:"#{event}!") if activity_pub.public_send(:"may_#{event}?")
flash[:success] = I18n.t("activity_pubs.#{event}.success")
rescue Exception => e
ExceptionNotifier.notify_exception(e, data: { site: site.name, params: params.permit!.to_h })
flash[:error] = I18n.t("activity_pubs.#{event}.error")
ensure
redirect_to_moderation_queue!
end
end
@ -49,6 +55,15 @@ class ActivityPubsController < ApplicationController
next unless activity_pub.public_send(may)
activity_pub.public_send(method)
flash[:success] = I18n.t('activity_pubs.action_on_several.success')
rescue Exception => e
ExceptionNotifier.notify_exception(e,
data: { site: site.name, params: params.permit!.to_h,
activity_pub: activity_pub.id })
flash.delete(:success)
flash[:error] = I18n.t('activity_pubs.action_on_several.error')
end
end
end

View file

@ -117,6 +117,19 @@ en:
text_report: Report
remote_flags:
report_message: "Hi! Someone using Sutty CMS reported this account on your instance. We don't have support for customized report messages yet, but we will soon. You can reach us at %{panel_actor_mention}."
activity_pubs:
action_on_several:
success: "Several comments have changed moderation state. You can find them using the filters on the Comments section."
error: "There was an error while changing moderation state. We received a report and will be acting on it soon."
approve:
success: "Comment approved."
error: "There was an error while approving the comment. We received a report and will be acting on it soon."
reject:
success: "Comment rejected. You can report it using the Report button."
error: "There was an error while rejecting the comment. We received a report and will be acting on it soon."
report:
success: "Comment reported."
error: "There was an error while reporting the comment. We received a report and will be acting on it soon."
actor_moderations:
action_on_several:
success: "Several accounts have changed moderation state. You can find them using the filters on the Accounts section."

View file

@ -116,6 +116,19 @@ es:
text_report: Reportar
remote_flags:
report_message: "¡Hola! Une usuarie de Sutty CMS reportó esta cuenta en tu instancia. Todavía no tenemos soporte para mensajes personalizados. Podés contactarnos en %{panel_actor_mention}."
activity_pubs:
action_on_several:
success: "Se ha modificado el estado de moderación de varios comentarios. Podés encontrarlos usando los filtros en la sección Comentarios."
error: "Hubo un error al modificar el estado de moderación de varios comentarios. Hemos recibido el reporte y lo estaremos verificando."
approve:
success: "Comentario aprobado."
error: "No se puedo aprobar el comentario. Hemos recibido el reporte y lo estaremos verificando."
reject:
success: "Comentario rechazado. Podés reportarlo usando el botón Reportar."
error: "No se puedo rechazar el comentario. Hemos recibido el reporte y lo estaremos verificando."
report:
success: "Comentario reportado."
error: "No se puedo reportar el comentario. Hemos recibido el reporte y lo estaremos verificando."
actor_moderations:
action_on_several:
success: "Se han modificado el estado de moderación de varias cuentas. Podés encontrarlas usando los filtros en la sección Cuentas."