actually render comments

This commit is contained in:
byte[] 2019-12-05 00:00:41 -05:00
parent 3d94deb7e5
commit 98260fac9f
2 changed files with 8 additions and 2 deletions

View file

@ -2,6 +2,7 @@ defmodule PhilomenaWeb.ProfileController do
use PhilomenaWeb, :controller use PhilomenaWeb, :controller
alias PhilomenaWeb.ImageLoader alias PhilomenaWeb.ImageLoader
alias Philomena.Textile.Renderer
alias Philomena.Users.User alias Philomena.Users.User
alias Philomena.Galleries.Gallery alias Philomena.Galleries.Gallery
alias Philomena.Posts.Post alias Philomena.Posts.Post
@ -48,6 +49,11 @@ defmodule PhilomenaWeb.ProfileController do
) )
|> Enum.filter(&Canada.Can.can?(current_user, :show, &1.image)) |> Enum.filter(&Canada.Can.can?(current_user, :show, &1.image))
recent_comments =
recent_comments
|> Renderer.render_collection(conn)
|> Enum.zip(recent_comments)
recent_posts = recent_posts =
Post.search_records( Post.search_records(
%{ %{

View file

@ -5,5 +5,5 @@
= link "View all", to: Routes.comment_path(@conn, :index, cq: "user_id:#{@user.id}") = link "View all", to: Routes.comment_path(@conn, :index, cq: "user_id:#{@user.id}")
.block__content .block__content
= for comment <- @comments do = for {body, comment} <- @comments do
= render PhilomenaWeb.CommentView, "_comment_with_image.html", comment: comment, conn: @conn = render PhilomenaWeb.CommentView, "_comment_with_image.html", comment: comment, body: body, conn: @conn