mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 23:36:21 +00:00
feat: acciones masivas para comentarios
This commit is contained in:
parent
b201c3de18
commit
b798980865
3 changed files with 22 additions and 4 deletions
|
@ -15,7 +15,23 @@ class ActivityPubsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def action_on_several
|
def action_on_several
|
||||||
|
activity_pubs = site.activity_pubs.where(id: params[:activity_pub])
|
||||||
|
|
||||||
|
authorize activity_pubs
|
||||||
|
|
||||||
|
action = params[:activity_pub_action].to_sym
|
||||||
|
method = :"#{action}!"
|
||||||
|
may = :"may_#{action}?"
|
||||||
|
|
||||||
redirect_to_moderation_queue!
|
redirect_to_moderation_queue!
|
||||||
|
|
||||||
|
return unless ActivityPub.events.include? action
|
||||||
|
|
||||||
|
ActivityPub.transaction do
|
||||||
|
activity_pubs.find_each do |activity_pub|
|
||||||
|
activity_pub.public_send(method) if activity_pub.public_send(may)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -69,8 +69,9 @@ en:
|
||||||
text_checked: With selected
|
text_checked: With selected
|
||||||
comments_checked_submenu:
|
comments_checked_submenu:
|
||||||
submenu_pause: Pause
|
submenu_pause: Pause
|
||||||
submenu_accept: Accept
|
submenu_approve: Approve
|
||||||
submenu_reject: Reject
|
submenu_reject: Reject
|
||||||
|
submenu_report: Report
|
||||||
comments_show_submenu:
|
comments_show_submenu:
|
||||||
submenu_paused: "Paused (%{count})"
|
submenu_paused: "Paused (%{count})"
|
||||||
submenu_approved: "Approved (%{count})"
|
submenu_approved: "Approved (%{count})"
|
||||||
|
|
|
@ -68,9 +68,10 @@ es:
|
||||||
text_show: Ver
|
text_show: Ver
|
||||||
text_checked: Con los marcados
|
text_checked: Con los marcados
|
||||||
comments_checked_submenu:
|
comments_checked_submenu:
|
||||||
submenu_pause: Pausado
|
submenu_pause: Pausar
|
||||||
submenu_accept: Aceptado
|
submenu_approve: Aprobar
|
||||||
submenu_reject: Rechazado
|
submenu_reject: Rechazar
|
||||||
|
submenu_report: Reportar
|
||||||
comments_show_submenu:
|
comments_show_submenu:
|
||||||
submenu_paused: "Pausados (%{count})"
|
submenu_paused: "Pausados (%{count})"
|
||||||
submenu_approved: "Aprobados (%{count})"
|
submenu_approved: "Aprobados (%{count})"
|
||||||
|
|
Loading…
Reference in a new issue