-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Spam comment moderation #2957
Spam comment moderation #2957
Conversation
Generated by 🚫 Danger |
@@ -59,5 +59,5 @@ begin | |||
|
|||
rescue => ex | |||
fail "There was an error with Danger bot's Junit parsing: #{ex.message}" | |||
puts ex.inspect # view the entire error output in the log | |||
message ex.inspect # view the entire error output in the log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to handle warning!
@@ -131,7 +131,9 @@ def mark_comment_spam | |||
if current_user && (current_user.role == 'moderator' || current_user.role == 'admin') | |||
if @comment.status == 1 | |||
@comment.spam | |||
flash[:notice] = "Comment has been marked as spam." | |||
user = @comment.author | |||
user.ban |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think should we moderate user or ban it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ban is right - moderation is for a code of conduct violation. But we should better explain this in documentation somewhere! For example the buttons shown on an admin's view of others' profiles is confusing - both are shown as options!
<a rel="tooltip" title="Mark as spam" class="btn btn-sm btn-default btn-flag-spam-<%= comment.id %>" data-confirm="Are you sure? The user will no longer be able to log in or publish, and their content will be hidden except comments." href="/admin/mark_comment_spam/<%= comment.id %>"> | ||
<i class="fa fa-ban"></i> | ||
</a> | ||
<% else %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have replaced "Flag as spam" with "mark as spam" for moderators and admins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@jywarren please review this one. I have left some comments above please see if I have started right as after that, the same links would be added to spam page and comment tab of the profile, so just confirming. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Ready to go when you are!
Looks like this drifted out of sync -- sorry, i just wanted to check with you that it's merge-able -- once you resolve the conflict, can you mark it 'ready'? Thank you @Gauravano !!! 👍 |
@jywarren I cleared conflicts but we can't merge this until its confirmed that all comments are migrated to status = 1. |
@jywarren we can merge this one now 😀 |
Hooray!!! 🎉 |
* change to status 1 * mark spam button for moderator and admin * ban user if comment marked as spam * test fix * danger file using message
Fixes #2304
Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
rake test
fixes #0000
-style reference to original issue #@publiclab/reviewers
for help, in a comment belowIf tests do fail, click on the red
X
to learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.
Thanks!