mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 11:26:22 +00:00
fix: movidas arrays de parametros de botones y filtros a helper moderation_queue_helper.rb #15077
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
cfae99ca7b
commit
40346df76d
11 changed files with 69 additions and 42 deletions
|
@ -37,30 +37,6 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
# parámetros de botones:
|
||||
# text: [texto del botón]
|
||||
# class: [clases css]
|
||||
# href: [href del botón]
|
||||
def botoneras_moderation_queue
|
||||
# botones de comentarios
|
||||
@btn_params = [[t('moderation_queue.button_box.text_pause'), 'btn-secondary', ''],
|
||||
[t('moderation_queue.button_box.text_reject'), 'btn-primary', ''],
|
||||
[t('moderation_queue.button_box.text_accept'), 'bg-blue white', ''],
|
||||
[t('moderation_queue.button_box.text_reply'), 'btn-outline-primary', ''],
|
||||
[t('moderation_queue.button_box.text_report'), 'btn-danger', '']]
|
||||
|
||||
#botones de remote_profile (cuentas)
|
||||
@profile_btn_params = [[t('moderation_queue.profile_button_box.text_approve'), 'btn-success', ''],
|
||||
[t('moderation_queue.profile_button_box.text_check'), 'btn-outline-success', ''],
|
||||
[t('moderation_queue.profile_button_box.text_deny'), 'bg-blue white', ''],
|
||||
[t('moderation_queue.profile_button_box.text_report'), 'btn-danger', '']]
|
||||
|
||||
#botones de instances (instancias)
|
||||
@instances_btn_params = [[t('moderation_queue.instances_button_box.text_check'), 'btn-outline-success', ''],
|
||||
[t('moderation_queue.instances_button_box.text_allow'), 'btn-success', ''],
|
||||
[t('moderation_queue.instances_button_box.text_deny'), 'btn-danger', '']]
|
||||
end
|
||||
|
||||
def notify_unconfirmed_email
|
||||
return unless current_usuarie
|
||||
return if current_usuarie.confirmed?
|
||||
|
|
|
@ -9,13 +9,11 @@ class ModerationQueueController < ApplicationController
|
|||
@moderation_queue.each do |activity|
|
||||
activity['attributedTo'] = @remote_profile
|
||||
end
|
||||
botoneras_moderation_queue
|
||||
end
|
||||
|
||||
# Perfil remoto de usuarie
|
||||
def remote_profile
|
||||
@remote_profile = YAML.safe_load(File.read(Rails.root.join('db', 'seeds', 'remote_profile.yaml')))
|
||||
botoneras_moderation_queue
|
||||
end
|
||||
|
||||
# todon.nl está usando /api/v2/instance
|
||||
|
|
|
@ -83,7 +83,6 @@ class PostsController < ApplicationController
|
|||
breadcrumb post.title.value, site_post_path(site, post, locale: locale), match: :exact
|
||||
breadcrumb 'posts.edit', ''
|
||||
dummy_data
|
||||
botoneras_moderation_queue
|
||||
end
|
||||
|
||||
def update
|
||||
|
|
47
app/helpers/moderation_queue_helper.rb
Normal file
47
app/helpers/moderation_queue_helper.rb
Normal file
|
@ -0,0 +1,47 @@
|
|||
module ModerationQueueHelper
|
||||
|
||||
# parámetros de botones:
|
||||
# text: [texto del botón]
|
||||
# class: [clases css]
|
||||
# href: [href del botón]
|
||||
def botoneras_moderation_queue
|
||||
# botones de comentarios
|
||||
@btn_params = [[t('moderation_queue.button_box.text_pause'), 'btn-secondary', ''],
|
||||
[t('moderation_queue.button_box.text_reject'), 'btn-primary', ''],
|
||||
[t('moderation_queue.button_box.text_accept'), 'bg-blue white', ''],
|
||||
[t('moderation_queue.button_box.text_reply'), 'btn-outline-primary', ''],
|
||||
[t('moderation_queue.button_box.text_report'), 'btn-danger', '']]
|
||||
|
||||
#botones de remote_profile (cuentas)
|
||||
@profile_btn_params = [[t('moderation_queue.profile_button_box.text_approve'), 'btn-success', ''],
|
||||
[t('moderation_queue.profile_button_box.text_check'), 'btn-outline-success', ''],
|
||||
[t('moderation_queue.profile_button_box.text_deny'), 'bg-blue white', ''],
|
||||
[t('moderation_queue.profile_button_box.text_report'), 'btn-danger', '']]
|
||||
|
||||
#botones de instances (instancias)
|
||||
@instances_btn_params = [[t('moderation_queue.instances_button_box.text_check'), 'btn-outline-success', ''],
|
||||
[t('moderation_queue.instances_button_box.text_allow'), 'btn-success', ''],
|
||||
[t('moderation_queue.instances_button_box.text_deny'), 'btn-danger', '']]
|
||||
end
|
||||
|
||||
# parámetros de filtros:
|
||||
# text: [texto del botón]
|
||||
# href: [href del botón]
|
||||
def filtros_moderation_queue
|
||||
@comment_filter_params = {
|
||||
t('moderation_queue.filter_box.text_checked') =>
|
||||
[
|
||||
[t('moderation_queue.filter_box.submenu_pause'), '/sutty.nl'],
|
||||
[t('moderation_queue.filter_box.submenu_reject'), '#reject'],
|
||||
[t('moderation_queue.filter_box.submenu_accept'),'#accept']
|
||||
],
|
||||
t('moderation_queue.filter_box.text_show') =>
|
||||
[
|
||||
[t('moderation_queue.filter_box.submenu_pause'), '#pause'],
|
||||
[t('moderation_queue.filter_box.submenu_reject'), '#reject'],
|
||||
[t('moderation_queue.filter_box.submenu_accept'),'#accept'],
|
||||
[t('moderation_queue.filter_box.submenu_report'), '#report']
|
||||
]
|
||||
}
|
||||
end
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
-# Componente Caja de Filtros
|
||||
|
||||
.d-flex.py-2.justify-content-center
|
||||
= render 'moderation_queue/filter_base', text: t('.text_checked')
|
||||
= render 'moderation_queue/filter_base', text: t('.text_show')
|
||||
= render 'moderation_queue/filter_base', text: t('.text_order')
|
|
@ -1,4 +1,6 @@
|
|||
= render 'moderation_queue/comment_filter_box'
|
||||
- filtros_moderation_queue
|
||||
- botoneras_moderation_queue
|
||||
= render 'moderation_queue/filter_box', filter_params: @comment_filter_params
|
||||
- @moderation_queue.each do |comment|
|
||||
|
||||
= render 'comment', comment: comment, profile: @remote_profile
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
-# Componente Filtro
|
||||
.dropdown.mx-4
|
||||
%button#dropdownMenuButton.btn.btn-outline-secondary.dropdown-toggle{:type => "button", "data-toggle" => "dropdown", "aria-haspopup" => "true", "aria-expanded" => "false"}
|
||||
%span #{text}
|
||||
%span= text
|
||||
.dropdown-menu{"aria-labelledby" => "dropdownMenuButton"}
|
||||
%a.dropdown-item{ href: '#' } Action
|
||||
%a.dropdown-item{ href: '#' } Another action
|
||||
%a.dropdown-item{ href: '#' } Something else here
|
||||
- menu.each do |subm|
|
||||
%a.dropdown-item{ href: subm[1] } subm[0]
|
||||
|
|
6
app/views/moderation_queue/_filter_box.haml
Normal file
6
app/views/moderation_queue/_filter_box.haml
Normal file
|
@ -0,0 +1,6 @@
|
|||
-# Componente Caja de Filtros
|
||||
|
||||
.d-flex.py-2.justify-content-center
|
||||
- filter_params.each do |filter, submenu|
|
||||
= render 'moderation_queue/filter_base', text: filter, menu: submenu
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
-# Componente Remote_Profile
|
||||
|
||||
.flex.py-2.mx-2.text-center
|
||||
- botoneras_moderation_queue
|
||||
%h4.mb-2= t('.profile_name') + ': ' + remote_profile['name']
|
||||
%h5= t('.profile_id') + ': ' + remote_profile['id']
|
||||
%h5= t('.profile_published') + ': ' + remote_profile['published'].to_datetime.strftime('%m/%d/%Y')
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
.flex
|
||||
%h3.text-center.py-2 Comentarios
|
||||
= render 'moderation_queue/comment_filter_box'
|
||||
- botoneras_moderation_queue
|
||||
- filtros_moderation_queue
|
||||
= render 'moderation_queue/filter_box', filter_params: @comment_filter_params
|
||||
- moderation_queue.each do |comment|
|
||||
= render 'moderation_queue/comment', comment: comment, profile: @remote_profile
|
||||
.row.d-flex.justify-content-center
|
||||
|
|
|
@ -24,10 +24,13 @@ es:
|
|||
text_accept: Aceptar Publicación
|
||||
text_reply: Responder
|
||||
text_report: Reportar
|
||||
comment_filter_box:
|
||||
text_order: Ordenar por
|
||||
filter_box:
|
||||
text_show: Ver
|
||||
text_checked: Con los marcados
|
||||
submenu_pause: Pausado
|
||||
submenu_reject: Rechazado
|
||||
submenu_accept: Aceptado
|
||||
submenu_report: Reportado
|
||||
instances_button_box:
|
||||
text_check: Moderar caso por caso
|
||||
text_allow: Permitir todo
|
||||
|
|
Loading…
Reference in a new issue