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 11 months ago

hackerESQ commented 11 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 11 months ago

Sounds good! Let me know if that works!

DavideIadeluca commented 9 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!

DavideIadeluca commented 1 month ago

It's been a while.. I had some thoughts about this, and I feel like adding another setting would make the already opaque permission/settings handling even worse.

I think for the next major release of this extension we should make the extension more opinionated by default but improve the extensibility of it.

Therefore, I'm actually inclined to close this PR because I'm not willing to maintain this. Thoughts @imorland?