From bbd5426da53c7d3677fcc72f17da0f74b42e519e Mon Sep 17 00:00:00 2001 From: jazzari Date: Thu, 1 Feb 2024 12:17:51 -0300 Subject: [PATCH] fix: eliminada botonera remote_profile_box para usar componente general button_box #15028 --- app/controllers/application_controller.rb | 7 ++++++- app/controllers/moderation_queue_controller.rb | 1 + app/views/moderation_queue/_profile_button_box.haml | 12 ------------ app/views/moderation_queue/_remote_profile.haml | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 app/views/moderation_queue/_profile_button_box.haml diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 360a9b2d..bcbf0bc2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -37,7 +37,7 @@ class ApplicationController < ActionController::Base end end - # parámetros de botones + # parámetros de botones: # text: [texto del botón] # class: [clases css] # href: [href del botón] @@ -48,6 +48,11 @@ class ApplicationController < ActionController::Base [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_deny'), 'btn-outline-info', ''], + [t('moderation_queue.profile_button_box.text_allow'), 'btn-success', 'https://sutty.nl/'], + [t('moderation_queue.profile_button_box.text_report'), 'btn-outline-danger', 'https://sutty.nl/']] end def notify_unconfirmed_email diff --git a/app/controllers/moderation_queue_controller.rb b/app/controllers/moderation_queue_controller.rb index 04a31389..5141990e 100644 --- a/app/controllers/moderation_queue_controller.rb +++ b/app/controllers/moderation_queue_controller.rb @@ -15,6 +15,7 @@ class ModerationQueueController < ApplicationController # 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 diff --git a/app/views/moderation_queue/_profile_button_box.haml b/app/views/moderation_queue/_profile_button_box.haml deleted file mode 100644 index d15b6ed0..00000000 --- a/app/views/moderation_queue/_profile_button_box.haml +++ /dev/null @@ -1,12 +0,0 @@ --# Componente Botonera de Profile - -.d-flex.py-2.justify-content-center - -# parámetros de botones - -# text, class, href - - 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/']] - - - comment_btn_params.each do |btn| - - @class = btn[1] - = render 'moderation_queue/btn_base', href: btn[2], class: @class, text: btn[0] diff --git a/app/views/moderation_queue/_remote_profile.haml b/app/views/moderation_queue/_remote_profile.haml index b665dcf2..a8d60c60 100644 --- a/app/views/moderation_queue/_remote_profile.haml +++ b/app/views/moderation_queue/_remote_profile.haml @@ -2,4 +2,4 @@ %h4= 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') - = render 'moderation_queue/profile_button_box' + = render 'moderation_queue/button_box', comment_btn_params: @profile_btn_params