comments: allow admins to remove comment votes (fix #4640)
Allow admins to remove comment votes by other users. This is done by clicking the comment score to get to the comment vote list, then clicking the Remove button on every vote.
This commit is contained in:
@@ -28,12 +28,16 @@ class CommentComponent < ApplicationComponent
|
||||
|
||||
def upvoted?
|
||||
return false if current_user.is_anonymous?
|
||||
comment.votes.active.select(&:is_positive?).map(&:user_id).include?(current_user.id)
|
||||
current_vote&.is_positive?
|
||||
end
|
||||
|
||||
def downvoted?
|
||||
return false if current_user.is_anonymous?
|
||||
comment.votes.active.select(&:is_negative?).map(&:user_id).include?(current_user.id)
|
||||
current_vote&.is_negative?
|
||||
end
|
||||
|
||||
def current_vote
|
||||
@current_vote ||= comment.votes.active.find { |v| v.user_id == current_user.id }
|
||||
end
|
||||
|
||||
def reported?
|
||||
|
||||
Reference in New Issue
Block a user