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