votes: add vote buttons beneath thumbnails.
Add upvote and downvote buttons beneath thumbnails on the post index page. This is disabled by default. To enable it, click the "..." menu in the top right of the page, then click "Show scores". This is currently a per-search setting, not an account setting. If you enable it in one tab, it won't be enabled in other tabs.
This commit is contained in:
@@ -23,8 +23,7 @@
|
||||
<p class="desc">
|
||||
<%= link_to pool.pretty_name.truncate(80), pool %>
|
||||
</p>
|
||||
<% end -%>
|
||||
<% if similarity -%>
|
||||
<% elsif similarity -%>
|
||||
<p class="desc">
|
||||
<% if post.source =~ %r!\Ahttps?://!i %>
|
||||
<%= external_link_to post.normalized_source, post.source_domain %>
|
||||
@@ -33,20 +32,19 @@
|
||||
<%= time_ago_in_words_tagged(post.created_at, compact: true) %>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
<% if size -%>
|
||||
<p class="desc">
|
||||
<%= link_to number_to_human_size(size), post.file_url %>
|
||||
(<%= post.image_width %>x<%= post.image_height %>)
|
||||
</p>
|
||||
<% end -%>
|
||||
<% if similarity -%>
|
||||
<p class="desc">
|
||||
<%= link_to "#{similarity}%", iqdb_queries_path(post_id: post.id) %> similarity
|
||||
</p>
|
||||
<% end -%>
|
||||
|
||||
<% if recommended -%>
|
||||
<% elsif size -%>
|
||||
<p class="desc">
|
||||
<%= link_to number_to_human_size(size), post.file_url %>
|
||||
(<%= post.image_width %>x<%= post.image_height %>)
|
||||
</p>
|
||||
<% elsif recommended -%>
|
||||
<p class="desc recommended">
|
||||
<%= link_to recommended_posts_path(search: { post_id: post.id }), class: "more-recommended-posts", "data-post-id": post.id do %>
|
||||
<%= post.fav_count %>
|
||||
@@ -56,5 +54,9 @@
|
||||
<br>more »
|
||||
<% end %>
|
||||
</p>
|
||||
<% elsif show_votes -%>
|
||||
<p class="desc">
|
||||
<%= render_post_votes post, current_user: current_user %>
|
||||
</p>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
Reference in New Issue
Block a user