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

@@ -1,11 +1,11 @@
class PostVotesController < ApplicationController
before_action :voter_only, only: [:create, :destroy]
before_action :voter_only
skip_before_action :api_check
respond_to :js, :json, :xml, :html
rescue_with PostVote::Error, status: 422
def index
@post_votes = PostVote.includes(:post, :user).paginated_search(params)
@post_votes = PostVote.includes(:user, post: [:uploader]).paginated_search(params)
respond_with(@post_votes)
end