From cc7175ab997f2febd906022b9af6a69df7d7e057 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 26 Feb 2024 16:51:33 -0300 Subject: [PATCH] feat: poder filtrar por estado de la instancia --- app/controllers/moderation_queue_controller.rb | 2 +- app/views/components/_instances_filters.haml | 2 +- app/views/components/_instances_show_submenu.haml | 5 +++-- app/views/moderation_queue/_instances.haml | 3 +++ config/locales/en.yml | 5 +++++ config/locales/es.yml | 6 ++++-- 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/controllers/moderation_queue_controller.rb b/app/controllers/moderation_queue_controller.rb index d2123234..8c030460 100644 --- a/app/controllers/moderation_queue_controller.rb +++ b/app/controllers/moderation_queue_controller.rb @@ -8,7 +8,7 @@ class ModerationQueueController < ApplicationController # @todo cambiar el estado por query @activity_pubs = site.activity_pubs - @instance_moderations = site.instance_moderations + @instance_moderations = rubanok_process(site.instance_moderations, with: InstanceModerationProcessor) end # Perfil remoto de usuarie diff --git a/app/views/components/_instances_filters.haml b/app/views/components/_instances_filters.haml index 213bb7c0..eac20d38 100644 --- a/app/views/components/_instances_filters.haml +++ b/app/views/components/_instances_filters.haml @@ -3,4 +3,4 @@ = render 'components/instances_checked_submenu' = render 'components/dropdown', text: t('.text_show') do - = render 'components/comments_show_submenu' + = render 'components/instances_show_submenu' diff --git a/app/views/components/_instances_show_submenu.haml b/app/views/components/_instances_show_submenu.haml index 1074cc3f..56206735 100644 --- a/app/views/components/_instances_show_submenu.haml +++ b/app/views/components/_instances_show_submenu.haml @@ -1,2 +1,3 @@ -= render 'components/dropdown_item', text: t('.submenu_allow'), path: '/' -= render 'components/dropdown_item', text: t('.submenu_reject'), path: '/' \ No newline at end of file += render 'components/dropdown_item', text: t('.submenu_paused'), path: site_moderation_queue_path(state: 'paused') += render 'components/dropdown_item', text: t('.submenu_allowed'), path: site_moderation_queue_path(state: 'allowed') += render 'components/dropdown_item', text: t('.submenu_blocked'), path: site_moderation_queue_path(state: 'blocked') diff --git a/app/views/moderation_queue/_instances.haml b/app/views/moderation_queue/_instances.haml index 2303a061..4c55c439 100644 --- a/app/views/moderation_queue/_instances.haml +++ b/app/views/moderation_queue/_instances.haml @@ -5,6 +5,9 @@ -# Filtros = render 'components/instances_filters' +- if instance_moderations.count.zero? + %h3= t('moderation_queue.nothing') + - instance_moderations.each do |instance_moderation| %hr = render 'moderation_queue/instance', instance: instance_moderation.instance diff --git a/config/locales/en.yml b/config/locales/en.yml index 1b4f2d86..188b85c4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -60,6 +60,10 @@ en: instances_show_submenu: submenu_allow: Allow submenu_reject: Reject + instances_show_submenu: + submenu_paused: Moderated + submenu_allowed: Allowed + submenu_blocked: Blocked comments_filters: text_show: Show text_checked: With selected @@ -102,6 +106,7 @@ en: text_deny: Block text_report: Report moderation_queue: + nothing: "There's nothing for this filter" index: title: Moderation instances: Instances diff --git a/config/locales/es.yml b/config/locales/es.yml index e277f76b..d3651cb7 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -58,8 +58,9 @@ es: submenu_allow: Permitir todo submenu_reject: Rechazado instances_show_submenu: - submenu_allow: Permitido - submenu_reject: Rechazado + submenu_paused: Pausadas + submenu_allowed: Permitidas + submenu_blocked: Bloqueadas comments_filters: text_show: Ver text_checked: Con los marcados @@ -102,6 +103,7 @@ es: text_deny: Bloquear text_report: Reportar moderation_queue: + nothing: 'No hay nada para este filtro' index: title: Actividades de moderaciĆ³n instances: Instancias