mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
actually render comments
This commit is contained in:
parent
3d94deb7e5
commit
98260fac9f
2 changed files with 8 additions and 2 deletions
|
@ -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(
|
||||||
%{
|
%{
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue