Files
danbooru/app/helpers/components_helper.rb
evazion ffdd5e6128 posts: make post votes work the same way as comment votes.
Change post votes to work the same way as comment votes:

* Make the upvote arrow blue if you've upvoted the post, or grey if you
  haven't. Likewise for the downvote arrow.
* Make it so you can click the upvote or downvote arrows to undo the vote.
* Don't show any notices when you vote on a post.

Also fix it so that votes work the same way on the posts page, the
comments page, and in the modqueue. Before it wasn't possible to undo
votes on the comments page or in the modqueue.
2021-01-29 02:21:08 -06:00

22 lines
574 B
Ruby

module ComponentsHelper
def post_preview(post, **options)
render PostPreviewComponent.new(post: post, **options)
end
def post_previews_html(posts, **options)
render PostPreviewComponent.with_collection(posts, **options)
end
def render_comment(comment, **options)
render CommentComponent.new(comment: comment, **options)
end
def render_comment_section(post, **options)
render CommentSectionComponent.new(post: post, **options)
end
def render_post_votes(post, **options)
render PostVotesComponent.new(post: post, **options)
end
end