comments: add scores, rework comment menu.

* Add comment scores.
* Rework voting buttons so that you can click the upvote/downvote
  buttons to toggle votes.
* Hide the edit, delete, undelete, and report buttons behind a popup menu.
* Show the upvote/downvote/reply buttons to logged out users. Redirect
  them to the login page instead.
This commit is contained in:
evazion
2021-01-20 03:10:59 -06:00
parent ccae422961
commit 5780ed5768
15 changed files with 149 additions and 64 deletions

View File

@@ -113,11 +113,6 @@ class Comment < ApplicationRecord
end
end
def voted_by?(user)
return false if user.is_anonymous?
user.id.in?(votes.map(&:user_id))
end
def quoted_response
DText.quote(body, creator.name)
end