mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 14:26:22 +00:00
feat: poder ir al perfil desde la lista
This commit is contained in:
parent
cf46988d9d
commit
3ba23a8b8c
11 changed files with 61 additions and 67 deletions
|
@ -12,9 +12,14 @@ class ActorModerationsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# Ver el perfil remoto
|
||||
def show
|
||||
@remote_profile = actor_moderation.actor.content
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def actor_moderation
|
||||
@actor_moderation ||= site.actor_moderations.find(params[:actor_moderation_id])
|
||||
@actor_moderation ||= site.actor_moderations.find(params[:actor_moderation_id] || params[:id])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,11 +14,6 @@ class ModerationQueueController < ApplicationController
|
|||
@actor_moderations = rubanok_process(site.actor_moderations, with: ActorModerationProcessor)
|
||||
end
|
||||
|
||||
# Perfil remoto de usuarie
|
||||
def remote_profile
|
||||
dummy_data
|
||||
end
|
||||
|
||||
# todon.nl está usando /api/v2/instance
|
||||
# mauve.moe usa /api/v1/instance
|
||||
def instances
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
.row.justify-content-center
|
||||
.col-md-8
|
||||
.col-12.col-md-8
|
||||
%h1= t('.profile')
|
||||
= render 'moderation_queue/remote_profile', remote_profile: @remote_profile
|
||||
= render 'components/actor', remote_profile: @remote_profile
|
||||
.col-12.col-md-8
|
||||
= render 'components/profiles_btn_box', actor_moderation: @actor_moderation
|
||||
-#
|
||||
= render 'moderation_queue/comments', moderation_queue: @moderation_queue
|
||||
|
|
21
app/views/components/_actor.haml
Normal file
21
app/views/components/_actor.haml
Normal file
|
@ -0,0 +1,21 @@
|
|||
-# Componente Remote_Profile
|
||||
|
||||
.py-2
|
||||
%dl
|
||||
%dt= t('.profile_name')
|
||||
%dd= sanitize remote_profile['name']
|
||||
|
||||
%dt= t('.preferred_name')
|
||||
%dd= sanitize remote_profile['preferredUsername']
|
||||
|
||||
%dt= t('.profile_id')
|
||||
%dd
|
||||
= link_to sanitize(remote_profile['id'])
|
||||
|
||||
- if remote_profile['published'].present?
|
||||
%dt= t('.profile_published')
|
||||
%dd
|
||||
= render 'layouts/time', time: sanitize(remote_profile['published'])
|
||||
%dt= t('.profile_summary')
|
||||
%dd
|
||||
= sanitize remote_profile['summary']
|
|
@ -1,9 +1,10 @@
|
|||
-# Componente Botonera de Moderación de Cuentas (Remote_profile)
|
||||
|
||||
- btn_class = 'btn-secondary'
|
||||
- ActorModeration.events.each do |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_class,
|
||||
disabled: !actor_moderation.public_send(:"may_#{actor_event}?")
|
||||
.d-flex.flex-row
|
||||
- btn_class = 'btn-secondary'
|
||||
- ActorModeration.events.each do |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_class,
|
||||
disabled: !actor_moderation.public_send(:"may_#{actor_event}?")
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
= render 'components/checkbox', id: profile['id'], name: 'actor[]', value: profile['id'], data: { target: 'select-all.input' }
|
||||
.col-11
|
||||
%h4
|
||||
%a{href: profile['id']}= sanitize profile['name']
|
||||
= link_to sanitize(profile['name']), site_actor_moderation_path(id: actor_moderation)
|
||||
.mb-3
|
||||
= sanitize profile['summary'].html_safe
|
||||
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
-# Componente Remote_Profile
|
||||
|
||||
.flex.py-2.mx-2
|
||||
%dl
|
||||
%dt= t('.profile_name')
|
||||
%dd= remote_profile['name']
|
||||
|
||||
%dt= t('.preferred_name')
|
||||
%dd= remote_profile['preferredUsername']
|
||||
|
||||
%dt= t('.profile_id')
|
||||
%dd
|
||||
%a{ href: 'https://mastodon.mauve.moe/users/mauve' }= remote_profile['id']
|
||||
|
||||
%dt= t('.profile_published')
|
||||
%dd
|
||||
= render 'layouts/time', time: remote_profile['published']
|
||||
%dt= t('.profile_summary')
|
||||
%dd
|
||||
%p= remote_profile['summary'].html_safe
|
||||
|
||||
= render 'moderation_queue/comments', moderation_queue: @moderation_queue
|
||||
|
||||
%dl.mt-5
|
||||
%dt= t('.profile_name')
|
||||
%dd= remote_profile['name']
|
||||
|
||||
-# Botones de Moderación
|
||||
= render 'components/profiles_btn_box'
|
|
@ -1,4 +0,0 @@
|
|||
.row.justify-content-center
|
||||
.col-md-8
|
||||
%h1= t('.profile')
|
||||
= render 'moderation_queue/remote_profile', remote_profile: @remote_profile
|
|
@ -106,6 +106,15 @@ en:
|
|||
text_allow: Always approve
|
||||
text_block: Block
|
||||
text_report: Report
|
||||
actor_moderations:
|
||||
show:
|
||||
user: Username
|
||||
profile: Profile
|
||||
profile_name: Profile name
|
||||
preferred_name: Name in Fediverse
|
||||
profile_id: ID
|
||||
profile_published: Published
|
||||
profile_summary: Summary
|
||||
moderation_queue:
|
||||
everything: 'Select all'
|
||||
nothing: "There's nothing for this filter"
|
||||
|
@ -117,14 +126,6 @@ en:
|
|||
comment:
|
||||
source_profile: Source Profile
|
||||
reply_to: Reply to
|
||||
remote_profile:
|
||||
user: Username
|
||||
profile: Profile
|
||||
profile_name: Profile name
|
||||
preferred_name: Name in Fediverse
|
||||
profile_id: ID
|
||||
profile_published: Published
|
||||
profile_summary: Summary
|
||||
instances:
|
||||
title: My block lists
|
||||
description: Description
|
||||
|
|
|
@ -106,6 +106,15 @@ es:
|
|||
text_allow: Aprobar siempre
|
||||
text_block: Bloquear
|
||||
text_report: Reportar
|
||||
actor_moderations:
|
||||
show:
|
||||
user: Nombre de usuarie
|
||||
profile: Cuenta de Origen
|
||||
profile_name: Nombre de la cuenta
|
||||
preferred_name: Nombre en el Fediverso
|
||||
profile_id: ID
|
||||
profile_published: Publicada
|
||||
profile_summary: Presentación
|
||||
moderation_queue:
|
||||
everything: 'Seleccionar todo'
|
||||
nothing: 'No hay nada para este filtro'
|
||||
|
@ -117,14 +126,6 @@ es:
|
|||
comment:
|
||||
source_profile: Cuenta de Origen
|
||||
reply_to: En respuesta a
|
||||
remote_profile:
|
||||
user: Nombre de usuario
|
||||
profile: Cuenta de Origen
|
||||
profile_name: Nombre de la Cuenta
|
||||
preferred_name: Nombre en el Fediverso
|
||||
profile_id: ID
|
||||
profile_published: Publicada
|
||||
profile_summary: Presentación
|
||||
instances:
|
||||
title: Mis listas de bloqueo
|
||||
description: Descripción de listas de bloqueo
|
||||
|
|
|
@ -59,7 +59,6 @@ Rails.application.routes.draw do
|
|||
post 'collaborate', to: 'collaborations#accept_collaboration'
|
||||
|
||||
get 'moderation_queue', to: 'moderation_queue#index'
|
||||
get 'remote_profile', to: 'moderation_queue#remote_profile'
|
||||
get 'instances', to: 'moderation_queue#instances'
|
||||
|
||||
resources :instance_moderations, only: [] do
|
||||
|
@ -71,7 +70,7 @@ Rails.application.routes.draw do
|
|||
patch :instance_moderations_action_on_several, to: 'instance_moderations#action_on_several'
|
||||
patch :fediblock_states_action_on_several, to: 'fediblock_states#action_on_several'
|
||||
|
||||
resources :actor_moderations, only: [] do
|
||||
resources :actor_moderations, only: %i[show] do
|
||||
ActorModeration.events.each do |actor_event|
|
||||
patch actor_event, to: "actor_moderations##{actor_event}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue