Files
danbooru/app/views/comments/_index_by_post.html.erb
evazion 07bdc6eab0 comments: rework thresholded comments.
Previously thresholded comments were hidden completely. You had to click
the "Show X hidden comments" button to unhide all hidden comments in a
thread. Now it works like this:

* When a comment is below your threshold, the comment text is hidden and
  replaced by a `[hidden]` link, which you can click to unhide the comment.

* When a comment is at half your threshold (for example, your threshold
  is -8 but the comment is at -4), then the comment is greyed out.

This means that comments aren't completely hidden, they're just
collapsed, so you can see the commenter and the score without unhiding
the comment. It also means you don't have to scroll back up to unhide a
comment, and threads aren't disrupted by comments being secretly
hidden (which is confusing when people are replying to hidden comments,
which forces you to go back up and unhide to find).
2021-01-19 04:07:33 -06:00

21 lines
642 B
Plaintext

<div id="p-index-by-post">
<% if @posts.blank? %>
<%= render "post_sets/blank" %>
<% end %>
<% @posts.select(&:visible?).each do |post| %>
<%= tag.div id: "post_#{post.id}", **PostPreviewComponent.new(post: post).article_attrs("post") do %>
<div class="preview">
<%= link_to(image_tag(post.preview_file_url), post_path(post)) %>
</div>
<div class="comment-section">
<%= render "comments/partials/index/header", post: post %>
<%= render_comment_section(post, limit: 6, current_user: CurrentUser.user) %>
</div>
<% end %>
<% end %>
</div>
<%= numbered_paginator(@posts) %>