2020-07-22 19:22:44 +00:00
|
|
|
<%= Enum.map(Content.Comments.children(@parent_id, @post.comments), fn comment -> %>
|
|
|
|
<li class="Comment">
|
|
|
|
<div class="Comment-topmatter">
|
|
|
|
<span class="Gravatar" style="background-image: url(<%= comment.comment_author_email |> gravatar_url_for_email %>)">
|
|
|
|
</span>
|
|
|
|
<h4>
|
|
|
|
<%= comment.comment_author || "Anonymous" %>
|
|
|
|
</h4>
|
|
|
|
<h5>
|
|
|
|
<%= comment.comment_date |> Timex.format!("%F", :strftime) %>
|
|
|
|
</h5>
|
|
|
|
</div>
|
|
|
|
<div class="Comment-content">
|
|
|
|
<%= sanitize comment.comment_content |> auto_paragraph_tags |> elem(1) |> IO.iodata_to_binary() %>
|
|
|
|
<p class="Comment-actions">
|
2020-07-24 22:10:50 +00:00
|
|
|
<a href="#reply-to-<%= comment.comment_id %>" class="Comment--replyLink">
|
2020-07-22 19:22:44 +00:00
|
|
|
➦ Reply
|
|
|
|
</a>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<ul class="CommentList">
|
2020-07-24 22:10:50 +00:00
|
|
|
<%= render "comments.html", post: @post, parent_id: comment.comment_id, conn: @conn %>
|
|
|
|
<li class="Comment Comment--replyForm" id="reply-to-<%= comment.comment_id %>">
|
2020-07-22 19:22:44 +00:00
|
|
|
<h4>
|
|
|
|
Reply to <%= comment.comment_author || "Anonymous" %>
|
|
|
|
</h4>
|
|
|
|
<%=
|
|
|
|
render "reply_form.html",
|
|
|
|
comment_changeset: comment_changeset_for_parent(comment),
|
|
|
|
conn: @conn
|
|
|
|
%>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<% end) %>
|