votes: fixup various minor issues.
* Add a gap between thumbnails on mobile. * Adjust CSS for scores and vote buttons. * Include "Private favorites" as an incentive on the user upgrade page. * Fix vote buttons not being visible beneath thumbnails on mobile. * Fix the "Show scores" link not preserving the current page number. * Fix vote buttons being unintentionally enabled for all thumbnails by default. * Fix banned and restricted users being able to favorite posts by tagging them with `fav:self`. * Fix search engines being able to crawl /posts?view=score pages. * Fix broken tests.
This commit is contained in:
@@ -548,9 +548,11 @@ class Post < ApplicationRecord
|
||||
pool&.add!(self)
|
||||
|
||||
when /^fav:(.+)$/i
|
||||
raise User::PrivilegeError unless Pundit.policy!(CurrentUser.user, Favorite).create?
|
||||
Favorite.create(post: self, user: CurrentUser.user)
|
||||
|
||||
when /^-fav:(.+)$/i
|
||||
raise User::PrivilegeError unless Pundit.policy!(CurrentUser.user, Favorite).create?
|
||||
Favorite.destroy_by(post: self, user: CurrentUser.user)
|
||||
|
||||
when /^(up|down)vote:(.+)$/i
|
||||
|
||||
Reference in New Issue
Block a user