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 #113

Open hackerESQ opened 9 months ago

hackerESQ commented 9 months ago

Fixes #32

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

hackerESQ commented 9 months ago

Sounds good! Let me know if that works!

DavideIadeluca commented 6 months ago

Hi @hackerESQ, similarly like in https://github.com/FriendsOfFlarum/gamification/pull/114 this PR has merge conflicts. Please reset the history to the first commit you made on this branch, amend it and force push without the dist files being changed. Thanks!