Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new option to hide voting when not allowed #113

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hackerESQ
Copy link

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

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

Required changes:
N/A

Copy link
Member

@imorland imorland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello and thank you for the PR!

Looks good to me, but can you please remove the dist files from this? In order to keep merging as straightforward as possible, the js will be automatically built once merged :)

@hackerESQ
Copy link
Author

Sounds good! Let me know if that works!

@hackerESQ hackerESQ marked this pull request as draft December 13, 2023 00:12
@hackerESQ hackerESQ marked this pull request as ready for review December 13, 2023 00:12
@DavideIadeluca
Copy link
Member

Hi @hackerESQ, similarly like in #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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tag-based voting / permission bug?
3 participants