5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 23:36:21 +00:00

fix: eliminadas botoneras de comentarios y remote_profile y unificadas en componente button_box #15028
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
jazzari 2024-02-01 12:02:40 -03:00
parent 94a86eca9b
commit 819ed25e29
9 changed files with 26 additions and 19 deletions

View file

@ -37,6 +37,19 @@ 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
@comment_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', '']]
end
def notify_unconfirmed_email
return unless current_usuarie
return if current_usuarie.confirmed?

View file

@ -9,6 +9,7 @@ class ModerationQueueController < ApplicationController
@moderation_queue.each do |activity|
activity['attributedTo'] = @remote_profile
end
botoneras_moderation_queue
end
# Perfil remoto de usuarie

View file

@ -83,6 +83,7 @@ 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

View file

@ -0,0 +1,6 @@
-# Componente Botonera de Moderación
.d-flex.py-2.justify-content-center
- comment_btn_params.each do |btn|
- @class = btn[1]
= render 'moderation_queue/btn_base', href: btn[2], class: @class, text: btn[0]

View file

@ -1,14 +0,0 @@
-# Componente Botonera de Moderación
.d-flex.py-2.justify-content-center
-# parámetros de botones
-# text, class, href
- btn_box_params = [[t('.text_pause'), 'btn-secondary', ''],
[t('.text_reject'), 'btn-primary', ''],
[t('.text_accept'), 'bg-blue white', ''],
[t('.text_reply'), 'btn-outline-primary', ''],
[t('.text_report'), 'btn-outline-danger', '']]
- btn_box_params.each do |btn|
- @class = btn[1]
= render 'moderation_queue/btn_base', href: btn[2], class: @class, text: btn[0]

View file

@ -3,10 +3,10 @@
.d-flex.py-2.justify-content-center
-# parámetros de botones
-# text, class, href
- btn_box_params = [[t('.text_deny'), 'btn-outline-info', ''],
- comment_btn_params = [[t('.text_deny'), 'btn-outline-info', ''],
[t('.text_allow'), 'btn-success', 'https://sutty.nl/'],
[t('.text_report'), 'btn-outline-danger', 'https://sutty.nl/']]
- btn_box_params.each do |btn|
- comment_btn_params.each do |btn|
- @class = btn[1]
= render 'moderation_queue/btn_base', href: btn[2], class: @class, text: btn[0]

View file

@ -2,4 +2,4 @@
- @moderation_queue.each do |comment|
= render 'comment', comment: comment, profile: @remote_profile
= render 'moderation_queue/comment_button_box'
= render 'moderation_queue/button_box', comment_btn_params: @comment_btn_params

View file

@ -4,4 +4,4 @@
- moderation_queue.each do |comment|
= render 'moderation_queue/comment', comment: comment, profile: @remote_profile
.row.d-flex.justify-content-center
= render 'moderation_queue/comment_button_box'
= render 'moderation_queue/button_box', comment_btn_params: @comment_btn_params

View file

@ -12,7 +12,7 @@ es:
text_deny: Bloquear que te siga
text_allow: Permitir que te siga
text_report: Reportar
comment_button_box:
button_box:
text_pause: Pausa
text_reject: Rechazar
text_accept: Aceptar Publicación