FriendsOfFlarum / gamification

Add upvotes, downvotes, and ranks to your Flarum Community
https://discuss.flarum.org/d/20671-friendsofflarum-gamification
MIT License
36 stars 17 forks source link

Add new option to hide voting when not allowed #112

Closed hackerESQ closed 11 months ago

hackerESQ commented 11 months ago

Fixes #32 and somewhat related to v17development/flarum-support-feedback#14

Changes proposed in this pull request: This adds a new option in extension settings that allows admins to hide voting options when the post/tag/user does not have permissions to vote.

Reviewers should focus on: This only adds a new configuration option. But perhaps the logic to hide should be reviewed:

if (setting('hideIfNoPermissions', true) && !post.canVote() && !post.canSeeVotes()) {
   return;
}

This same logic was added to the alternate layout as well.

Screenshot

image

Confirmed

Required changes: N/A