recommendations: show favcount beneath recommended posts.

* Add favorite count beneath recommended posts. Clicking the favcount
  loads more recommended posts like that post.
* Increase number of recommendations shown on post show page.
This commit is contained in:
evazion
2019-12-02 02:07:37 -06:00
parent efda9f37e1
commit 5791f4e805
4 changed files with 42 additions and 3 deletions

View File

@@ -32,4 +32,20 @@
<%= link_to "#{similarity}%", iqdb_queries_path(post_id: post.id) %> similarity
</p>
<% end -%>
<% if 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 %>
<% if post.favorited_by?(CurrentUser.id) %>
<i class="fas fa-heart fa-xs"></i>
<% else %>
<i class="far fa-heart fa-xs"></i>
<% end %>
<br>more »
<% end %>
</p>
<% end -%>
<% end -%>