Files
danbooru/app/views/comments/_index_by_post.html.erb
evazion c36c0b9e7a views: refactor atom feed links.
* Fix comment & forum feeds to include search params.
* Remove global post feeds (only include post feeds on post index).
2020-01-26 19:16:38 -06:00

25 lines
975 B
Plaintext

<div id="p-index-by-post">
<% if !CurrentUser.user.is_builder? %>
<div style="margin-bottom: 1em;">
<h2>Before commenting, read the <%= link_to_wiki "how to comment guide", "howto:comment" %>.</h2>
</div>
<% end %>
<% if @posts.blank? %>
<%= render "post_sets/blank" %>
<% end %>
<% @posts.select(&:visible?).each do |post| %>
<% if post.comments.visible(CurrentUser.user).any? || post.comments.hidden(CurrentUser.user).any? %>
<%= content_tag(:div, { id: "post_#{post.id}", class: ["post", *PostPresenter.preview_class(post)].join(" ") }.merge(PostPresenter.data_attributes(post))) do %>
<div class="preview">
<%= link_to(image_tag(post.preview_file_url), post_path(post)) %>
</div>
<%= render "comments/partials/index/list", post: post, comments: post.comments.visible(CurrentUser.user).last(6), page: :comments %>
<% end %>
<% end %>
<% end %>
</div>
<%= numbered_paginator(@posts) %>