plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Moderating first-timer comments

Open grvsachdeva opened this issue 8 years ago • 17 comments

We currently moderate first-timer question, note for preventing spam. Now, comments are also becoming a issue, so it's decided in #2304 that we would be implementing the similar moderation system as that of nodes for comments too.

  • [x] Check if the user is a first-time commenter or not, if the user has published a note before then he/she shouldn't be considered as the first-time commenter. Make a function in comment.rb for this. --- #3509

  • [x] Make a function in comment.rb which will change the status of comment to 4 (status = 1 represent normal comment, status = 4 represent under moderation).

  • [x] In comment_controller.rb check for the first-time commenter if it is, then changes status to 4 using the function build in 1

  • [x] Add the view for moderated comment just we have for node

  • [x] Make a comment_moderation mailer and add the tests for it

  • [x] Make a comment approval/spammed mail and add the tests for it.

  • [x] Call both mailers at appropriate places from comment.rb and comment_controller.rb

  • [x] Add functional tests

  • [x] Write documentation about using extra status field

  • [x] Moderated comments viewability to different users - (#4470)

  • [x] Append under-moderation comment in comments section using AJAX visible to author/moderator (--- followup)

@jywarren please review the steps. Thanks!

grvsachdeva avatar Sep 14 '18 20:09 grvsachdeva

Thank you! I think potentially displaying comments as greyed-out until they are approved? This is related to your last item.

Both on individual notes, questions, wiki pages (these share templates i think) but also at /comments

Also, potentially have a /comments option which shows as-yet-unapproved comments? Like /comments?status=unapproved maybe?

jywarren avatar Sep 24 '18 22:09 jywarren

Thanks and sorry it took me a while to respond!!! 👍

jywarren avatar Sep 24 '18 22:09 jywarren

I think potentially displaying comments as greyed-out until they are approved? This is related to your last item.

yes, you got it right!

Both on individual notes, questions, wiki pages (these share templates i think) but also at /comments

I will take care

Also, potentially have a /comments option which shows as-yet-unapproved comments? Like /comments?status=unapproved

I will add it as follow-up.

okay, breaking it now. Thanks @jywarren !

grvsachdeva avatar Sep 25 '18 14:09 grvsachdeva

Awesome!

On Tue, Sep 25, 2018 at 10:29 AM Gaurav Sachdeva [email protected] wrote:

Reopened #3331 https://github.com/publiclab/plots2/issues/3331.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/3331#event-1865902314, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ3sBkZbWC2v9Gpdm3929HcJbsrQ4ks5uej2egaJpZM4Wp6Ju .

jywarren avatar Sep 25 '18 16:09 jywarren

Maybe this could be a good source of GCI issues!!!

jywarren avatar Oct 31 '18 18:10 jywarren

working on the tests :+1: :) https://github.com/publiclab/plots2/pull/4103

digitaldina avatar Dec 03 '18 02:12 digitaldina

We've been working on this, there are a lot new features ready and maybe we can mark them as done.

Done

  • [x] Check if the user is a first-time commenter or not, if the user has published a note before then he/she #4047

  • [x] Make a function in comment.rb which will change the status of comment to 4 (status = 1 represent normal comment, status = 4 represent under moderation).

  • [x] In comment_controller.rb check for the first-time commenter if it is, then changes status to 4 using the function build in 1.

    The two last points have changed. Now, when a new comment is created and the author is first-time-poster, you set the status (4) before creating, so the function isn't necessary. You can check the discussion here #4098

  • [x] Add the view for moderated comment just we have for node #4219

  • [x] Call both mailers at appropriate places from comment.rb and comment_controller.rb (#4226 #4098 #4217 #4068)

  • [x] Add functional tests (Test were added in the pull request correspondent) (#4226 #4098 #4217 #4068)

To Do

  • [x] Make a comment_moderation mailer and add the tests for it
  • [x] Make a comment approval/spammed mail and add the tests for it.
  • [ ] Write documentation about using extra status field
  • [ ] Append under-moderation comment in comments section using AJAX visible to author/moderator (--- followup)

Great work here @gauravano :) 💯Please tell me if I'm forgetting something

vatbq avatar Dec 11 '18 21:12 vatbq

This is awesome!!!!

On Tue, Dec 11, 2018, 4:57 PM Valentina Tironi <[email protected] wrote:

We've been working on this, there are a lot new features ready and maybe we can mark them as done. Done

Check if the user is a first-time commenter or not, if the user has published a note before then he/she #4047 https://github.com/publiclab/plots2/issues/4047

Make a function in comment.rb which will change the status of comment to 4 (status = 1 represent normal comment, status = 4 represent under moderation).

In comment_controller.rb check for the first-time commenter if it is, then changes status to 4 using the function build in 1.

The two last points have changed. Now, when a new comment is created and the author is first-time-poster, you set the status (4) before creating, so the function isn't necessary. You can check the discussion here #4098 https://github.com/publiclab/plots2/pull/4098

Add the view for moderated comment just we have for node #4219 https://github.com/publiclab/plots2/pull/4219

Call both mailers at appropriate places from comment.rb and comment_controller.rb (#4226 https://github.com/publiclab/plots2/pull/4226 #4098 https://github.com/publiclab/plots2/pull/4098 #4217 https://github.com/publiclab/plots2/pull/4217 #4068 https://github.com/publiclab/plots2/pull/4068)

Add functional tests (Test were added in the pull request correspondent) (#4226 https://github.com/publiclab/plots2/pull/4226 #4098 https://github.com/publiclab/plots2/pull/4098 #4217 https://github.com/publiclab/plots2/pull/4217 #4068 https://github.com/publiclab/plots2/pull/4068)

To Do

  • Make a comment_moderation mailer and add the tests for it
  • Make a comment approval/spammed mail and add the tests for it.
  • Write documentation about using extra status field
  • Append under-moderation comment in comments section using AJAX visible to author/moderator (--- followup)

Great work here @gauravano https://github.com/gauravano :) 💯Please tell me if I'm forgetting something

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/3331#issuecomment-446377491, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJxYRSR918eTQ3-rm_30FJeSOdiMOks5u4CoWgaJpZM4Wp6Ju .

jywarren avatar Dec 11 '18 22:12 jywarren

@ValentinaTironi although I'm quite busy this week, I will have a lot of time this weekend to put toward working on stuff, so I'd love to help with the first task on the todo! I would like to actually make it though, since I think I want a change from writing the tests and try something new. Great idea!

digitaldina avatar Dec 11 '18 23:12 digitaldina

That sounds fantastic @dinaelhanan! I think we can make it happens

vatbq avatar Dec 12 '18 05:12 vatbq

Hi @dinaelhanan I have updated the issue checklist only 2 parts are remaining. Thanks to @ValentinaTironi for her great work in solving all the tasks.

Last 2 parts are remaining, you are welcome to complete those. Also, feel free to mention me if you need any clarification or help. Thanks :smiley: !

grvsachdeva avatar Dec 15 '18 11:12 grvsachdeva

@gauravano I would love to get started on the documentation! Is it targeted to the users? also where can I see this feature/the code that affects it? Thanks!

digitaldina avatar Dec 15 '18 20:12 digitaldina

Hey @dinaelhanan, you have to make changes in this section - https://github.com/publiclab/plots2/blob/master/doc/DATA_MODEL.md#comments

What you have to do -

Notice the Node status part in this section - https://github.com/publiclab/plots2/blob/master/doc/DATA_MODEL.md#nodes

You have to copy that node status list and append the similar list to comment section but without status 5.

Why all this? As we have made status = 4 for comment moderation and as we are adding status so it's good to avoid any confusion among new contributors. Any questions are welcome?

Thanks!

grvsachdeva avatar Dec 15 '18 20:12 grvsachdeva

@gauravano Oh so do I just let people know that those nodes are used for the comments and what they mean? Like a list of all statuses except 5, then say what they mean, and how they are related to the comments, right? thanks!

digitaldina avatar Dec 15 '18 20:12 digitaldina

First copy that node status part to comment section part. Then, node keyword would be replaced by comment. And, status =5 not needed there.

Status for Node are now same for comment in our Code base except status =5.

grvsachdeva avatar Dec 15 '18 21:12 grvsachdeva

@gauravano Ok I've made the changes however I'm not seeing status =5. Do you mean the status 4? I left that in just in case. Thanks!

digitaldina avatar Dec 16 '18 03:12 digitaldina

Moderated comment visibility at comment node before moderating:

  • Comment author: Visible for question, not for note
  • Moderator: Visible for question, not for note
  • Any user: Visible for question, not for note
  • Without session: Visible for question, not for note

grvsachdeva avatar Jan 06 '19 13:01 grvsachdeva