From 98260fac9f49e2a931fbabda003d7ab9aea22af8 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Thu, 5 Dec 2019 00:00:41 -0500 Subject: [PATCH] actually render comments --- lib/philomena_web/controllers/profile_controller.ex | 6 ++++++ .../templates/profile/_recent_comments.html.slime | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/philomena_web/controllers/profile_controller.ex b/lib/philomena_web/controllers/profile_controller.ex index c1fb1100..d1e14a4e 100644 --- a/lib/philomena_web/controllers/profile_controller.ex +++ b/lib/philomena_web/controllers/profile_controller.ex @@ -2,6 +2,7 @@ defmodule PhilomenaWeb.ProfileController do use PhilomenaWeb, :controller alias PhilomenaWeb.ImageLoader + alias Philomena.Textile.Renderer alias Philomena.Users.User alias Philomena.Galleries.Gallery alias Philomena.Posts.Post @@ -48,6 +49,11 @@ defmodule PhilomenaWeb.ProfileController do ) |> Enum.filter(&Canada.Can.can?(current_user, :show, &1.image)) + recent_comments = + recent_comments + |> Renderer.render_collection(conn) + |> Enum.zip(recent_comments) + recent_posts = Post.search_records( %{ diff --git a/lib/philomena_web/templates/profile/_recent_comments.html.slime b/lib/philomena_web/templates/profile/_recent_comments.html.slime index 72b5de9d..c5e49948 100644 --- a/lib/philomena_web/templates/profile/_recent_comments.html.slime +++ b/lib/philomena_web/templates/profile/_recent_comments.html.slime @@ -5,5 +5,5 @@ = link "View all", to: Routes.comment_path(@conn, :index, cq: "user_id:#{@user.id}") .block__content - = for comment <- @comments do - = render PhilomenaWeb.CommentView, "_comment_with_image.html", comment: comment, conn: @conn + = for {body, comment} <- @comments do + = render PhilomenaWeb.CommentView, "_comment_with_image.html", comment: comment, body: body, conn: @conn