Fix #4931: Add popup voter list for comments.

Show the comment's upvote and downvote count when you hover over a
comment's score. For mods, show the list of voters as well.
This commit is contained in:
evazion
2021-11-24 22:13:32 -06:00
parent 594b46a85d
commit a45e6b5cfe
15 changed files with 159 additions and 9 deletions

View File

@@ -53,13 +53,13 @@
<%= link_to upvote_icon, comment_comment_votes_path(comment_id: comment.id, score: "1"), class: "comment-upvote-link inactive-link", method: :post, remote: true %>
<% end %>
<% if policy(CommentVote).can_see_votes? %>
<%= link_to comment_votes_path(search: { comment_id: comment.id }, variant: "compact"), class: "inactive-link" do %>
<span class="comment-score"><%= comment.score %></span>
<span class="comment-score">
<% if policy(CommentVote).can_see_votes? %>
<%= link_to comment.score, comment_votes_path(search: { comment_id: comment.id }, variant: "compact"), class: "inactive-link" %>
<% else %>
<%= comment.score %>
<% end %>
<% else %>
<span class="comment-score"><%= comment.score %></span>
<% end %>
</span>
<% if current_user.is_anonymous? %>
<%= link_to downvote_icon, login_path(url: request.fullpath), class: "comment-downvote-link inactive-link" %>

View File

@@ -36,6 +36,7 @@ article.comment {
text-align: center;
min-width: 1.25em;
white-space: nowrap;
vertical-align: middle;
}
.icon {