post/comment/forum votes: add vote counts to profile pages.

* Add post/comment/forum vote counts to user profiles.
* Show uploaders on post votes index and allow searching by uploader.
* Show forum posters on forum votes index and allow searching by poster.
* Add unvote link to forum votes index.
* Only show unvote links to current user.
This commit is contained in:
evazion
2019-10-28 14:34:56 -05:00
parent d3165f78aa
commit fd4a9d4d30
7 changed files with 48 additions and 14 deletions

View File

@@ -87,9 +87,11 @@
<% if CurrentUser.user == user || CurrentUser.user.is_admin? %>
<tr>
<th>Post Votes</th>
<th>Votes</th>
<td>
<%= link_to user.post_votes.count, post_votes_path(search: { user_name: user.name }) %>
<%= link_to user.post_votes.count, post_votes_path(search: { user_name: user.name }) %> posts,
<%= link_to user.comment_votes.count, comment_votes_path(search: { user_name: user.name }) %> comments,
<%= link_to user.forum_post_votes.count, forum_post_votes_path(search: { creator_name: user.name }) %> forum posts
</td>
</tr>
<% end %>