/comments: add vote buttons beneath thumbnails on /comments page.

Also fix an N+1 queries problem.
This commit is contained in:
evazion
2021-11-21 18:04:52 -06:00
parent be5173c8dd
commit 00befc96f0
4 changed files with 3 additions and 12 deletions

View File

@@ -3,9 +3,9 @@
<%= render "post_sets/blank" %>
<% end %>
<% @posts.select(&:visible?).each do |post| %>
<% @posts.includes(:media_asset, :uploader, :vote_by_current_user, comments: [:creator, :votes]).select(&:visible?).each do |post| %>
<%= tag.div id: "post_#{post.id}", **PostPreviewComponent.new(post: post).article_attrs("post space-x-4") do %>
<%= post_preview(post, show_deleted: true) %>
<%= post_preview(post, show_deleted: true, show_votes: true) %>
<div class="flex-1">
<%= render "comments/partials/index/header", post: post %>