/comments: break out index_by_post/index_by_comment into partials.

This commit is contained in:
evazion
2017-06-18 22:32:51 -05:00
parent 835f5d5426
commit 87da9ec873
6 changed files with 69 additions and 79 deletions

View File

@@ -0,0 +1,21 @@
<div class="comments-for-post">
<div class="list-of-comments">
<% @comments.each do |comment| %>
<% if CurrentUser.is_moderator? || !comment.is_deleted? %>
<div id="post_<%= comment.post.id %>" class="post <%= PostPresenter.preview_class(comment.post) %>" <%= PostPresenter.data_attributes(comment.post) %>>
<div class="preview">
<% if comment.post.visible? %>
<%= link_to(image_tag(comment.post.preview_file_url), post_path(comment.post)) %>
<% end %>
</div>
<%= render :partial => "comments/partials/show/comment", :collection => [comment] %>
<div class="clearfix"></div>
</div>
<% end %>
<% end %>
</div>
</div>
<%= numbered_paginator(@comments) %>
<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(:atom, search: params[:search]), title: "Comments")) %>