mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 03:16:23 +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
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
94a86eca9b
commit
819ed25e29
9 changed files with 26 additions and 19 deletions
|
@ -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?
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
6
app/views/moderation_queue/_button_box.haml
Normal file
6
app/views/moderation_queue/_button_box.haml
Normal 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]
|
|
@ -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]
|
|
@ -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]
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue