mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-27 10:46:22 +00:00
Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl
This commit is contained in:
commit
29847f6bdd
12 changed files with 31 additions and 25 deletions
|
@ -128,18 +128,19 @@ class ActivityPub < ApplicationRecord
|
|||
|
||||
# La actividad fue rechazada
|
||||
event :reject do
|
||||
transitions from: %i[paused], to: :rejected
|
||||
transitions from: %i[paused approved], to: :rejected
|
||||
|
||||
after do
|
||||
ActivityPub::InboxJob.perform_later(site: site, activity: activities.first.uri, action: :reject)
|
||||
end
|
||||
end
|
||||
|
||||
# Solo podemos reportarla luego de rechazarla
|
||||
# Reportarla implica rechazarla
|
||||
event :report do
|
||||
transitions from: :rejected, to: :reported
|
||||
transitions from: %i[paused approved rejected], to: :reported
|
||||
|
||||
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?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -43,7 +43,7 @@ class ActorModeration < ApplicationRecord
|
|||
# Al reportar, necesitamos asociar una RemoteFlag para poder
|
||||
# enviarla.
|
||||
event :report do
|
||||
transitions from: %i[blocked], to: :reported
|
||||
transitions from: %i[pause allowed blocked], to: :reported, after: :synchronize!
|
||||
|
||||
after do
|
||||
ActivityPub::RemoteFlagJob.perform_later(remote_flag: remote_flag) if remote_flag.waiting?
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
-# Componente Botón general Moderación
|
||||
|
||||
- local_assigns[:method] ||= 'patch'
|
||||
- local_assigns[:class] ||= 'btn-secondary'
|
||||
- local_assigns[:class] = "btn #{local_assigns[:class]}"
|
||||
- local_assigns.delete(:text)
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
-# 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
|
||||
- ActivityPub.events.each do |event|
|
||||
- possible = activity_pub.public_send(:"may_#{event}?")
|
||||
= render 'components/btn_base',
|
||||
text: t(".text_#{event}"),
|
||||
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]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
- 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?
|
||||
= render 'components/dropdown', text: t('.text_checked') do
|
||||
= render 'components/comments_checked_submenu', form: form
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
|
||||
- local_data = {}
|
||||
- InstanceModeration.events.each do |event|
|
||||
- possible = instance_moderation.public_send(:"may_#{event}?")
|
||||
= render 'components/btn_base',
|
||||
path: public_send(:"site_instance_moderation_#{event}_path", instance_moderation_id: instance_moderation),
|
||||
text: t(".text_#{event}"),
|
||||
class: 'btn btn-secondary',
|
||||
disabled: !instance_moderation.public_send(:"may_#{event}?"),
|
||||
class: ('btn-secondary' if possible),
|
||||
disabled: !possible,
|
||||
data: local_data[event]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
- 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?
|
||||
= render 'components/dropdown', text: t('.text_checked') do
|
||||
= render 'components/instances_checked_submenu', form: form, current_state: current_state
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
.d-flex.flex-row
|
||||
- local_data = { report: { confirm: t('.confirm_report') } }
|
||||
- ActorModeration.events.each do |actor_event|
|
||||
- possible = !actor_moderation.public_send(:"may_#{actor_event}?")
|
||||
= render 'components/btn_base',
|
||||
text: t(".text_#{actor_event}"),
|
||||
path: public_send(:"site_actor_moderation_#{actor_event}_path", actor_moderation_id: actor_moderation),
|
||||
class: 'btn-secondary',
|
||||
disabled: !actor_moderation.public_send(:"may_#{actor_event}?"),
|
||||
class: ('btn-secondary' if possible),
|
||||
disabled: !possible,
|
||||
data: local_data[actor_event]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
- 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?
|
||||
= render 'components/dropdown', text: t('.text_checked') do
|
||||
= render 'components/profiles_checked_submenu', form: form, current_state: current_state
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
%dd.d-inline
|
||||
%small
|
||||
%a{ href: in_reply_to }= in_reply_to
|
||||
.content
|
||||
.content.mb-3
|
||||
- if summary.present?
|
||||
= render 'layouts/details', summary: summary, summary_class: 'h5' do
|
||||
= sanitize comment['content']
|
||||
|
|
|
@ -63,7 +63,7 @@ en:
|
|||
instances_blocked: Instances blocked
|
||||
instances_filters:
|
||||
text_show: Show
|
||||
text_checked: With selected
|
||||
text_checked: With selected...
|
||||
instances_checked_submenu:
|
||||
submenu_pause: Moderate
|
||||
submenu_allow: Allow
|
||||
|
@ -74,7 +74,7 @@ en:
|
|||
submenu_blocked: "Blocked (%{count})"
|
||||
comments_filters:
|
||||
text_show: Show
|
||||
text_checked: With selected
|
||||
text_checked: With selected...
|
||||
comments_checked_submenu:
|
||||
submenu_pause: Pause
|
||||
submenu_approve: Approve
|
||||
|
@ -87,7 +87,7 @@ en:
|
|||
submenu_reported: "Reported (%{count})"
|
||||
profiles_filters:
|
||||
text_show: Show
|
||||
text_checked: With selected
|
||||
text_checked: With selected...
|
||||
profiles_checked_submenu:
|
||||
submenu_pause: Pause
|
||||
submenu_allow: Allow
|
||||
|
@ -106,7 +106,8 @@ en:
|
|||
text_reject: Reject
|
||||
text_reply: Reply
|
||||
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:
|
||||
text_pause: Check case by case
|
||||
text_allow: Allow everything
|
||||
|
@ -116,7 +117,7 @@ en:
|
|||
text_allow: Always approve
|
||||
text_block: Block
|
||||
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:
|
||||
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:
|
||||
|
|
|
@ -63,7 +63,7 @@ es:
|
|||
instances_blocked: Instancias bloqueadas
|
||||
instances_filters:
|
||||
text_show: Ver
|
||||
text_checked: Con los marcados
|
||||
text_checked: Con los marcados...
|
||||
instances_checked_submenu:
|
||||
submenu_pause: Moderar caso por caso
|
||||
submenu_allow: Permitir todo
|
||||
|
@ -74,7 +74,7 @@ es:
|
|||
submenu_blocked: "Bloqueadas (%{count})"
|
||||
comments_filters:
|
||||
text_show: Ver
|
||||
text_checked: Con los marcados
|
||||
text_checked: Con los marcados...
|
||||
comments_checked_submenu:
|
||||
submenu_pause: Pausar
|
||||
submenu_approve: Aprobar
|
||||
|
@ -87,7 +87,7 @@ es:
|
|||
submenu_reported: "Reportados (%{count})"
|
||||
profiles_filters:
|
||||
text_show: Ver
|
||||
text_checked: Con los marcados
|
||||
text_checked: Con los marcados...
|
||||
profiles_checked_submenu:
|
||||
submenu_pause: Pausar
|
||||
submenu_allow: Aceptar
|
||||
|
@ -105,7 +105,8 @@ es:
|
|||
text_approve: Aceptar
|
||||
text_reject: Rechazar
|
||||
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:
|
||||
text_pause: Moderar caso por caso
|
||||
text_allow: Permitir todo
|
||||
|
@ -115,7 +116,7 @@ es:
|
|||
text_allow: Aprobar siempre
|
||||
text_block: Bloquear
|
||||
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:
|
||||
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:
|
||||
|
|
Loading…
Reference in a new issue