philomena/lib/philomena_web/templates/profile/_recent_comments.html.heex
2024-05-04 17:09:20 -04:00

15 lines
541 B
Text

<%= if Enum.any?(@comments) do %>
<div class="block">
<div class="block__header">
<span class="block__header__title">
Recent Comments
</span>
<%= link("View all", to: ~p"/comments?#{[cq: "user_id:#{@user.id}"]}") %>
</div>
<div class="block__content">
<%= for {body, comment} <- @comments, can?(@conn, :show, comment.image) do %>
<%= render(PhilomenaWeb.CommentView, "_comment_with_image.html", comment: comment, body: body, conn: @conn) %>
<% end %>
</div>
</div>
<% end %>