diff --git a/lib/philomena_web/templates/comment/index.html.slime b/lib/philomena_web/templates/comment/index.html.slime index ae3e2eb0..4fe78810 100644 --- a/lib/philomena_web/templates/comment/index.html.slime +++ b/lib/philomena_web/templates/comment/index.html.slime @@ -17,7 +17,7 @@ h2 Search Results - route = fn p -> ~p"/comments?#{p}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @comments, route: route, params: [cq: @conn.params["cq"]], conn: @conn - = for {body, comment} <- @comments, comment.image.hidden_from_users == false do + = for {body, comment} <- @comments, comment.image.hidden_from_users == false and can_view_communication?(@conn, comment) do = render PhilomenaWeb.CommentView, "_comment_with_image.html", body: body, comment: comment, conn: @conn .block diff --git a/lib/philomena_web/templates/post/index.html.slime b/lib/philomena_web/templates/post/index.html.slime index 6313a9dc..d95e76b0 100644 --- a/lib/philomena_web/templates/post/index.html.slime +++ b/lib/philomena_web/templates/post/index.html.slime @@ -17,7 +17,7 @@ h2 Search Results - route = fn p -> ~p"/posts?#{p}" end - pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @posts, route: route, params: [pq: @conn.params["pq"]], conn: @conn - = for {body, post} <- @posts, post.topic.hidden_from_users == false do + = for {body, post} <- @posts, post.topic.hidden_from_users == false and can_view_communication?(@conn, post) do div h3 =<> link post.topic.forum.name, to: ~p"/forums/#{post.topic.forum}"