gamification icon indicating copy to clipboard operation
gamification copied to clipboard

Add new option to hide voting when not allowed

Open hackeresq opened this issue 1 year ago • 2 comments

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

  • [X] Frontend changes: tested on a local Flarum installation.
  • [X] Backend changes: tests are green (run composer test).

Required changes: N/A

hackeresq avatar Dec 05 '23 18:12 hackeresq

Sounds good! Let me know if that works!

hackeresq avatar Dec 13 '23 00:12 hackeresq

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 avatar Feb 29 '24 18:02 DavideIadeluca

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?

DavideIadeluca avatar Oct 05 '24 17:10 DavideIadeluca