5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-10-07 13:36:55 +00:00

Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl

This commit is contained in:
Sutty 2024-03-20 20:54:02 +00:00
commit 29847f6bdd
12 changed files with 31 additions and 25 deletions

View file

@ -128,18 +128,19 @@ class ActivityPub < ApplicationRecord
# La actividad fue rechazada # La actividad fue rechazada
event :reject do event :reject do
transitions from: %i[paused], to: :rejected transitions from: %i[paused approved], to: :rejected
after do after do
ActivityPub::InboxJob.perform_later(site: site, activity: activities.first.uri, action: :reject) ActivityPub::InboxJob.perform_later(site: site, activity: activities.first.uri, action: :reject)
end end
end end
# Solo podemos reportarla luego de rechazarla # Reportarla implica rechazarla
event :report do event :report do
transitions from: :rejected, to: :reported transitions from: %i[paused approved rejected], to: :reported
after do after do
ActivityPub::InboxJob.perform_later(site: site, activity: activities.first.uri, action: :reject)
ActivityPub::RemoteFlagJob.perform_later(remote_flag: remote_flag) if remote_flag.waiting? ActivityPub::RemoteFlagJob.perform_later(remote_flag: remote_flag) if remote_flag.waiting?
end end
end end

View file

@ -43,7 +43,7 @@ class ActorModeration < ApplicationRecord
# Al reportar, necesitamos asociar una RemoteFlag para poder # Al reportar, necesitamos asociar una RemoteFlag para poder
# enviarla. # enviarla.
event :report do event :report do
transitions from: %i[blocked], to: :reported transitions from: %i[pause allowed blocked], to: :reported, after: :synchronize!
after do after do
ActivityPub::RemoteFlagJob.perform_later(remote_flag: remote_flag) if remote_flag.waiting? ActivityPub::RemoteFlagJob.perform_later(remote_flag: remote_flag) if remote_flag.waiting?

View file

@ -1,7 +1,6 @@
-# Componente Botón general Moderación -# Componente Botón general Moderación
- local_assigns[:method] ||= 'patch' - local_assigns[:method] ||= 'patch'
- local_assigns[:class] ||= 'btn-secondary'
- local_assigns[:class] = "btn #{local_assigns[:class]}" - local_assigns[:class] = "btn #{local_assigns[:class]}"
- local_assigns.delete(:text) - local_assigns.delete(:text)

View file

@ -1,11 +1,13 @@
-# Componente Botonera de Comentarios -# Componente Botonera de Comentarios
- local_data = { report: { confirm: t('.confirm_report') } } - local_data = { reject: { confirm: t('.confirm_reject') }, report: { confirm: t('.confirm_report') } }
.d-flex.flex-row .d-flex.flex-row
- ActivityPub.events.each do |event| - ActivityPub.events.each do |event|
- possible = activity_pub.public_send(:"may_#{event}?")
= render 'components/btn_base', = render 'components/btn_base',
text: t(".text_#{event}"), text: t(".text_#{event}"),
path: public_send(:"site_activity_pub_#{event}_path", activity_pub_id: activity_pub), path: public_send(:"site_activity_pub_#{event}_path", activity_pub_id: activity_pub),
disabled: !activity_pub.public_send(:"may_#{event}?"), class: ('btn-secondary' if possible),
disabled: !possible,
data: local_data[event] data: local_data[event]

View file

@ -3,7 +3,7 @@
- current_state = params[:activity_pub_state]&.to_sym || ActivityPub.states.first - current_state = params[:activity_pub_state]&.to_sym || ActivityPub.states.first
.d-flex.py-2 .d-flex.flex-row.justify-content-between.py-2
- if ActivityPub.transitionable_events(current_state).present? - if ActivityPub.transitionable_events(current_state).present?
= render 'components/dropdown', text: t('.text_checked') do = render 'components/dropdown', text: t('.text_checked') do
= render 'components/comments_checked_submenu', form: form = render 'components/comments_checked_submenu', form: form

View file

@ -2,9 +2,10 @@
- local_data = {} - local_data = {}
- InstanceModeration.events.each do |event| - InstanceModeration.events.each do |event|
- possible = instance_moderation.public_send(:"may_#{event}?")
= render 'components/btn_base', = render 'components/btn_base',
path: public_send(:"site_instance_moderation_#{event}_path", instance_moderation_id: instance_moderation), path: public_send(:"site_instance_moderation_#{event}_path", instance_moderation_id: instance_moderation),
text: t(".text_#{event}"), text: t(".text_#{event}"),
class: 'btn btn-secondary', class: ('btn-secondary' if possible),
disabled: !instance_moderation.public_send(:"may_#{event}?"), disabled: !possible,
data: local_data[event] data: local_data[event]

View file

@ -3,7 +3,7 @@
- current_state = params[:state]&.to_sym || InstanceModeration.states.first - current_state = params[:state]&.to_sym || InstanceModeration.states.first
.d-flex.py-2 .d-flex.flex-row.justify-content-between.py-2
- if InstanceModeration.transitionable_events(current_state).present? - if InstanceModeration.transitionable_events(current_state).present?
= render 'components/dropdown', text: t('.text_checked') do = render 'components/dropdown', text: t('.text_checked') do
= render 'components/instances_checked_submenu', form: form, current_state: current_state = render 'components/instances_checked_submenu', form: form, current_state: current_state

View file

@ -2,9 +2,10 @@
.d-flex.flex-row .d-flex.flex-row
- local_data = { report: { confirm: t('.confirm_report') } } - local_data = { report: { confirm: t('.confirm_report') } }
- ActorModeration.events.each do |actor_event| - ActorModeration.events.each do |actor_event|
- possible = !actor_moderation.public_send(:"may_#{actor_event}?")
= render 'components/btn_base', = render 'components/btn_base',
text: t(".text_#{actor_event}"), text: t(".text_#{actor_event}"),
path: public_send(:"site_actor_moderation_#{actor_event}_path", actor_moderation_id: actor_moderation), path: public_send(:"site_actor_moderation_#{actor_event}_path", actor_moderation_id: actor_moderation),
class: 'btn-secondary', class: ('btn-secondary' if possible),
disabled: !actor_moderation.public_send(:"may_#{actor_event}?"), disabled: !possible,
data: local_data[actor_event] data: local_data[actor_event]

View file

@ -3,7 +3,7 @@
- current_state = params[:actor_state]&.to_sym || ActorModeration.states.first - current_state = params[:actor_state]&.to_sym || ActorModeration.states.first
.d-flex.py-2 .d-flex.flex-row.justify-content-between.py-2
- if ActorModeration.transitionable_events(current_state).present? - if ActorModeration.transitionable_events(current_state).present?
= render 'components/dropdown', text: t('.text_checked') do = render 'components/dropdown', text: t('.text_checked') do
= render 'components/profiles_checked_submenu', form: form, current_state: current_state = render 'components/profiles_checked_submenu', form: form, current_state: current_state

View file

@ -38,7 +38,7 @@
%dd.d-inline %dd.d-inline
%small %small
%a{ href: in_reply_to }= in_reply_to %a{ href: in_reply_to }= in_reply_to
.content .content.mb-3
- if summary.present? - if summary.present?
= render 'layouts/details', summary: summary, summary_class: 'h5' do = render 'layouts/details', summary: summary, summary_class: 'h5' do
= sanitize comment['content'] = sanitize comment['content']

View file

@ -63,7 +63,7 @@ en:
instances_blocked: Instances blocked instances_blocked: Instances blocked
instances_filters: instances_filters:
text_show: Show text_show: Show
text_checked: With selected text_checked: With selected...
instances_checked_submenu: instances_checked_submenu:
submenu_pause: Moderate submenu_pause: Moderate
submenu_allow: Allow submenu_allow: Allow
@ -74,7 +74,7 @@ en:
submenu_blocked: "Blocked (%{count})" submenu_blocked: "Blocked (%{count})"
comments_filters: comments_filters:
text_show: Show text_show: Show
text_checked: With selected text_checked: With selected...
comments_checked_submenu: comments_checked_submenu:
submenu_pause: Pause submenu_pause: Pause
submenu_approve: Approve submenu_approve: Approve
@ -87,7 +87,7 @@ en:
submenu_reported: "Reported (%{count})" submenu_reported: "Reported (%{count})"
profiles_filters: profiles_filters:
text_show: Show text_show: Show
text_checked: With selected text_checked: With selected...
profiles_checked_submenu: profiles_checked_submenu:
submenu_pause: Pause submenu_pause: Pause
submenu_allow: Allow submenu_allow: Allow
@ -106,7 +106,8 @@ en:
text_reject: Reject text_reject: Reject
text_reply: Reply text_reply: Reply
text_report: Report text_report: Report
confirm_report: "Send report to the remote instance?" confirm_report: "Send report to the remote instance? This action will also reject the comment."
confirm_reject: "Reject this comment? Please notice we can't undo this action at this moment."
instances_btn_box: instances_btn_box:
text_pause: Check case by case text_pause: Check case by case
text_allow: Allow everything text_allow: Allow everything
@ -116,7 +117,7 @@ en:
text_allow: Always approve text_allow: Always approve
text_block: Block text_block: Block
text_report: Report text_report: Report
confirm_report: "Send report to the remote instance?" confirm_report: "Send report to the remote instance? This action will also block the account."
remote_flags: 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}." 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: activity_pubs:

View file

@ -63,7 +63,7 @@ es:
instances_blocked: Instancias bloqueadas instances_blocked: Instancias bloqueadas
instances_filters: instances_filters:
text_show: Ver text_show: Ver
text_checked: Con los marcados text_checked: Con los marcados...
instances_checked_submenu: instances_checked_submenu:
submenu_pause: Moderar caso por caso submenu_pause: Moderar caso por caso
submenu_allow: Permitir todo submenu_allow: Permitir todo
@ -74,7 +74,7 @@ es:
submenu_blocked: "Bloqueadas (%{count})" submenu_blocked: "Bloqueadas (%{count})"
comments_filters: comments_filters:
text_show: Ver text_show: Ver
text_checked: Con los marcados text_checked: Con los marcados...
comments_checked_submenu: comments_checked_submenu:
submenu_pause: Pausar submenu_pause: Pausar
submenu_approve: Aprobar submenu_approve: Aprobar
@ -87,7 +87,7 @@ es:
submenu_reported: "Reportados (%{count})" submenu_reported: "Reportados (%{count})"
profiles_filters: profiles_filters:
text_show: Ver text_show: Ver
text_checked: Con los marcados text_checked: Con los marcados...
profiles_checked_submenu: profiles_checked_submenu:
submenu_pause: Pausar submenu_pause: Pausar
submenu_allow: Aceptar submenu_allow: Aceptar
@ -105,7 +105,8 @@ es:
text_approve: Aceptar text_approve: Aceptar
text_reject: Rechazar text_reject: Rechazar
text_report: Reportar text_report: Reportar
confirm_report: "¿Enviar el reporte a la instancia remota?" confirm_report: "¿Enviar el reporte a la instancia remota? Esta acción también rechazará el comentario."
confirm_reject: "¿Rechazar este comentario? Tené en cuenta que por el momento no es posible deshacer esta acción."
instances_btn_box: instances_btn_box:
text_pause: Moderar caso por caso text_pause: Moderar caso por caso
text_allow: Permitir todo text_allow: Permitir todo
@ -115,7 +116,7 @@ es:
text_allow: Aprobar siempre text_allow: Aprobar siempre
text_block: Bloquear text_block: Bloquear
text_report: Reportar text_report: Reportar
confirm_report: "¿Enviar el reporte a la instancia remota?" confirm_report: "¿Enviar el reporte a la instancia remota? Esta acción también bloqueará la cuenta."
remote_flags: 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}." 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: activity_pubs: