From f6a93b5bc21722d731cceef54a66c0bb17c2b222 Mon Sep 17 00:00:00 2001 From: jazzari Date: Thu, 25 Jan 2024 16:15:20 -0300 Subject: [PATCH] fix: corregida llamada en _moderation_queue para mostrar comentarios en vista posts/edit --- app/controllers/posts_controller.rb | 1 + app/views/moderation_queue/_comment_button_box.haml | 8 ++++---- app/views/moderation_queue/index.haml | 1 - app/views/posts/_moderation_queue.haml | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index d572e052..12b3ab55 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -82,6 +82,7 @@ class PostsController < ApplicationController authorize post breadcrumb post.title.value, site_post_path(site, post, locale: locale), match: :exact breadcrumb 'posts.edit', '' + @moderation_queue = YAML.safe_load(File.read(Rails.root.join('db', 'seeds', 'moderation_queue.yaml'))) end def update diff --git a/app/views/moderation_queue/_comment_button_box.haml b/app/views/moderation_queue/_comment_button_box.haml index 99744088..13a9c8a3 100644 --- a/app/views/moderation_queue/_comment_button_box.haml +++ b/app/views/moderation_queue/_comment_button_box.haml @@ -4,10 +4,10 @@ -# parĂ¡metros de botones -# text, class, href - @btn_box_params = [[t('.text_pause'), 'btn-outline-secondary disabled', ''], - [t('.text_reject'), 'btn-outline-info', 'https://sutty.nl/'], - [t('.text_accept'), 'bg-blue white', 'https://sutty.nl/'], - [t('.text_reply'), 'btn-outline-dark', 'https://sutty.nl/'], - [t('.text_report'), 'btn-outline-danger', 'https://sutty.nl/']] + [t('.text_reject'), 'btn-outline-info', ''], + [t('.text_accept'), 'bg-blue white', ''], + [t('.text_reply'), 'btn-outline-dark', ''], + [t('.text_report'), 'btn-outline-danger', '']] - @btn_box_params.each do |btn| - @class = btn[1] diff --git a/app/views/moderation_queue/index.haml b/app/views/moderation_queue/index.haml index 0881add2..0c693d26 100644 --- a/app/views/moderation_queue/index.haml +++ b/app/views/moderation_queue/index.haml @@ -1,4 +1,3 @@ - @moderation_queue.each do |comment| = render 'comment', comment: comment --# %h1= comment['id'] \ No newline at end of file diff --git a/app/views/posts/_moderation_queue.haml b/app/views/posts/_moderation_queue.haml index 4b405bbb..c754d51d 100644 --- a/app/views/posts/_moderation_queue.haml +++ b/app/views/posts/_moderation_queue.haml @@ -1,3 +1,4 @@ .flex %h3.text-center.py-2 Comentarios - = render 'moderation_queue/comment' \ No newline at end of file + - @moderation_queue.each do |comment| + = render 'moderation_queue/comment', comment: comment \ No newline at end of file