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

Spam comment moderation #2957

Merged
merged 6 commits into from
Jul 10, 2018
Merged

Conversation

grvsachdeva
Copy link
Member

Fixes #2304

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts
  • PR is descriptively titled
  • PR body includes fixes #0000-style reference to original issue #
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If 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!

@ghost ghost assigned grvsachdeva Jun 30, 2018
@ghost ghost added the in progress label Jun 30, 2018
@plotsbot
Copy link
Collaborator

plotsbot commented Jun 30, 2018

1 Warning
⚠️ It looks like you merged from master in this pull request. Please rebase to get rid of the merge commits – you may want to rewind the master branch and rebase instead of merging in from master, which can cause problems when accepting new code!
1 Message
📖 @Gauravano Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.

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
Copy link
Member Author

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
Copy link
Member Author

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 ?

Copy link
Member

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 %>
Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@grvsachdeva
Copy link
Member Author

@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!

Copy link
Member

@jywarren jywarren left a 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!

@jywarren
Copy link
Member

jywarren commented Jul 6, 2018

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 !!! 👍

@grvsachdeva
Copy link
Member Author

@jywarren I cleared conflicts but we can't merge this until its confirmed that all comments are migrated to status = 1.

@grvsachdeva
Copy link
Member Author

@jywarren we can merge this one now 😀

@jywarren jywarren merged commit d866329 into publiclab:master Jul 10, 2018
@ghost ghost removed the ready label Jul 10, 2018
@jywarren
Copy link
Member

Hooray!!! 🎉

SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
* change to status 1

* mark spam button for moderator and admin

* ban user if comment marked as spam

* test fix

* danger file using message
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.

PLANNING ISSUE: Spam comments moderation
3 participants