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:
@@ -101,6 +101,7 @@
|
||||
<div id="tooltips">
|
||||
<div id="post-tooltips"></div>
|
||||
<div id="user-tooltips"></div>
|
||||
<div id="post-votes-tooltips"></div>
|
||||
<div id="popup-menus"></div>
|
||||
</div>
|
||||
|
||||
|
||||
7
app/views/post_votes/_search.html.erb
Normal file
7
app/views/post_votes/_search.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<%= search_form_for(post_votes_path) do |f| %>
|
||||
<%= f.input :user_name, label: "Voter", input_html: { value: params[:search][:user_name], "data-autocomplete": "user" } %>
|
||||
<%= f.input :post_id, label: "Post", input_html: { value: params[:search][:post_id] } %>
|
||||
<%= f.input :post_tags_match, label: "Tags", input_html: { value: params[:search][:post_tags_match], "data-autocomplete": "tag-query" } %>
|
||||
<%= f.input :score, collection: [["+3", "3"], ["+1", "1"], ["-1", "-1"], ["-3", "-3"]], include_blank: true, selected: params[:search][:score] %>
|
||||
<%= f.submit "Search" %>
|
||||
<% end %>
|
||||
24
app/views/post_votes/index.html+compact.erb
Normal file
24
app/views/post_votes/index.html+compact.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<%= render "posts/partials/common/secondary_links" %>
|
||||
|
||||
<div id="c-post-votes">
|
||||
<div id="a-index">
|
||||
<%= render "search" %>
|
||||
|
||||
<%= table_for @post_votes, class: "striped autofit" do |t| %>
|
||||
<% t.column "Score" do |vote| %>
|
||||
<%= link_to sprintf("%+d", vote.score), post_votes_path(search: { score: vote.score }) %>
|
||||
<% end %>
|
||||
|
||||
<% t.column "Voter" do |vote| %>
|
||||
<%= link_to_user vote.user %>
|
||||
<%= link_to "»", post_votes_path(search: { user_name: vote.user.name }) %>
|
||||
<% end %>
|
||||
|
||||
<% t.column "Created" do |vote| %>
|
||||
<%= time_ago_in_words_tagged(vote.created_at) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= numbered_paginator(@post_votes) %>
|
||||
</div>
|
||||
</div>
|
||||
1
app/views/post_votes/index.html+tooltip.erb
Normal file
1
app/views/post_votes/index.html+tooltip.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= render_post_votes_tooltip(@post, current_user: CurrentUser.user) %>
|
||||
@@ -1,12 +1,6 @@
|
||||
<div id="c-post-votes">
|
||||
<div id="a-index">
|
||||
<%= search_form_for(post_votes_path) do |f| %>
|
||||
<%= f.input :user_name, label: "Voter", input_html: { value: params[:search][:user_name], "data-autocomplete": "user" } %>
|
||||
<%= f.input :post_id, label: "Post", input_html: { value: params[:search][:post_id] } %>
|
||||
<%= f.input :post_tags_match, label: "Tags", input_html: { value: params[:search][:post_tags_match], "data-autocomplete": "tag-query" } %>
|
||||
<%= f.input :score, collection: [["+3", "3"], ["+1", "1"], ["-1", "-1"], ["-3", "-3"]], include_blank: true, selected: params[:search][:score] %>
|
||||
<%= f.submit "Search" %>
|
||||
<% end %>
|
||||
<%= render "search" %>
|
||||
|
||||
<%= table_for @post_votes, class: "striped autofit" do |t| %>
|
||||
<% t.column "Post" do |vote| %>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="post-tooltip-body <%= "has-preview" if params[:preview].truthy? %>">
|
||||
<div class="post-tooltip-body thin-scrollbar <%= "has-preview" if params[:preview].truthy? %>">
|
||||
<div class="post-tooltip-body-left">
|
||||
<% if params[:preview].truthy? %>
|
||||
<%= post_preview(@post, show_deleted: true, compact: true) %>
|
||||
|
||||
Reference in New Issue
Block a user