mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 01:06: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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Ver el perfil remoto
|
||||||
|
def show
|
||||||
|
@remote_profile = actor_moderation.actor.content
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def actor_moderation
|
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,11 +14,6 @@ class ModerationQueueController < ApplicationController
|
||||||
@actor_moderations = rubanok_process(site.actor_moderations, with: ActorModerationProcessor)
|
@actor_moderations = rubanok_process(site.actor_moderations, with: ActorModerationProcessor)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Perfil remoto de usuarie
|
|
||||||
def remote_profile
|
|
||||||
dummy_data
|
|
||||||
end
|
|
||||||
|
|
||||||
# todon.nl está usando /api/v2/instance
|
# todon.nl está usando /api/v2/instance
|
||||||
# mauve.moe usa /api/v1/instance
|
# mauve.moe usa /api/v1/instance
|
||||||
def instances
|
def instances
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
.row.justify-content-center
|
.row.justify-content-center
|
||||||
.col-md-8
|
.col-12.col-md-8
|
||||||
%h1= t('.profile')
|
%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,5 +1,6 @@
|
||||||
-# Componente Botonera de Moderación de Cuentas (Remote_profile)
|
-# Componente Botonera de Moderación de Cuentas (Remote_profile)
|
||||||
|
|
||||||
|
.d-flex.flex-row
|
||||||
- btn_class = 'btn-secondary'
|
- btn_class = 'btn-secondary'
|
||||||
- ActorModeration.events.each do |actor_event|
|
- ActorModeration.events.each do |actor_event|
|
||||||
= render 'components/btn_base',
|
= render 'components/btn_base',
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
= render 'components/checkbox', id: profile['id'], name: 'actor[]', value: profile['id'], data: { target: 'select-all.input' }
|
= render 'components/checkbox', id: profile['id'], name: 'actor[]', value: profile['id'], data: { target: 'select-all.input' }
|
||||||
.col-11
|
.col-11
|
||||||
%h4
|
%h4
|
||||||
%a{href: profile['id']}= sanitize profile['name']
|
= link_to sanitize(profile['name']), site_actor_moderation_path(id: actor_moderation)
|
||||||
.mb-3
|
.mb-3
|
||||||
= sanitize profile['summary'].html_safe
|
= 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_allow: Always approve
|
||||||
text_block: Block
|
text_block: Block
|
||||||
text_report: Report
|
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:
|
moderation_queue:
|
||||||
everything: 'Select all'
|
everything: 'Select all'
|
||||||
nothing: "There's nothing for this filter"
|
nothing: "There's nothing for this filter"
|
||||||
|
@ -117,14 +126,6 @@ en:
|
||||||
comment:
|
comment:
|
||||||
source_profile: Source Profile
|
source_profile: Source Profile
|
||||||
reply_to: Reply to
|
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:
|
instances:
|
||||||
title: My block lists
|
title: My block lists
|
||||||
description: Description
|
description: Description
|
||||||
|
|
|
@ -106,6 +106,15 @@ es:
|
||||||
text_allow: Aprobar siempre
|
text_allow: Aprobar siempre
|
||||||
text_block: Bloquear
|
text_block: Bloquear
|
||||||
text_report: Reportar
|
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:
|
moderation_queue:
|
||||||
everything: 'Seleccionar todo'
|
everything: 'Seleccionar todo'
|
||||||
nothing: 'No hay nada para este filtro'
|
nothing: 'No hay nada para este filtro'
|
||||||
|
@ -117,14 +126,6 @@ es:
|
||||||
comment:
|
comment:
|
||||||
source_profile: Cuenta de Origen
|
source_profile: Cuenta de Origen
|
||||||
reply_to: En respuesta a
|
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:
|
instances:
|
||||||
title: Mis listas de bloqueo
|
title: Mis listas de bloqueo
|
||||||
description: Descripción de 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'
|
post 'collaborate', to: 'collaborations#accept_collaboration'
|
||||||
|
|
||||||
get 'moderation_queue', to: 'moderation_queue#index'
|
get 'moderation_queue', to: 'moderation_queue#index'
|
||||||
get 'remote_profile', to: 'moderation_queue#remote_profile'
|
|
||||||
get 'instances', to: 'moderation_queue#instances'
|
get 'instances', to: 'moderation_queue#instances'
|
||||||
|
|
||||||
resources :instance_moderations, only: [] do
|
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 :instance_moderations_action_on_several, to: 'instance_moderations#action_on_several'
|
||||||
patch :fediblock_states_action_on_several, to: 'fediblock_states#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|
|
ActorModeration.events.each do |actor_event|
|
||||||
patch actor_event, to: "actor_moderations##{actor_event}"
|
patch actor_event, to: "actor_moderations##{actor_event}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue