votes: show votes when hovering over post score.

Make it so you can hover over a post's score to see the list of public
upvotes. Also show the upvote count, the downvote count, and the upvote
ratio.
This commit is contained in:
evazion
2021-11-18 01:05:24 -06:00
parent a9997d0d2b
commit 5585d1f7d6
20 changed files with 262 additions and 58 deletions

View File

@@ -7,7 +7,9 @@
<% end %>
<% end %>
<span class="post-score"><%= post.score %></span>
<span class="post-score">
<%= link_to post.score, post_votes_path(search: { post_id: post.id }, variant: :compact) %>
</span>
<% if can_vote? %>
<% if downvoted? %>

View File

@@ -6,5 +6,11 @@
text-align: center;
min-width: 1.25em;
white-space: nowrap;
vertical-align: middle;
a {
color: var(--text-color);
&:hover { text-decoration: underline; }
}
}
}