plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Add a button to report answers spams to Comments upon Answers

Open stefannibrasil opened this issue 8 years ago • 18 comments

Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!

We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

📋 Step by Step

  • [ ] 🙋 Claim this issue: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!

  • [ ] 📝 Update the file app/views/questions/_comment.html.erb in the plots2 repository (press the little pen Icon) and edit the line as shown below.

See this page for some help in taking your first steps!

Below is a "diff" showing in green (and a +) with lines to add after line 28 in file (Remember to be careful with the indentation):

<div class="inline pull-xs-right" style="vertical-align: top">
+   <a rel="tooltip" title="Flag as spam" class="btn btn-sm btn-default btn-flag-spam-<%= comment.id %>" href="mailto:[email protected]?subject=Reporting+spam+on+Public+Lab&body=Hi,+I+found+this+comment+that+looks+like+spam+or+needs+to+be+moderated:+https://publiclab.org/<%= comment.parent.path %>#c<%= comment.cid %>+by+https://publiclab.org/profile/<%= comment.author.username %>+Thanks!">
+     <i class="fa fa-flag"></i>
+   </a>
    <p><% if answer_id == 0 && current_user && (current_user.role == "admin" || current_user.role == "moderator" || comment.uid == current_user.uid)%>
    <a class="btn btn-default btn-sm" id="answer-<%= answer_id %>-comment-<%= comment.id %>-reorder-btn" data-remote="true" data-confirm="Are you sure? <% if current_user && comment.uid != current_user.uid %>Please exercise caution in promoting others' comments; this cannot be undone.<% end %>" rel="tooltip" title="<%= t('questions._comment.promotion') %>" data-placement="left" href="/comment/make_answer/<%= comment.id %>"><i class="fa fa-plus"></i></a>
    <% end %>
    <% if current_user && current_user.uid == comment.uid %>
    <a class="btn btn-default btn-sm" onClick="$('#answer-<%= answer_id %>-comment-<%= comment.id %> .content').toggle();$('#answer-<%= answer_id %>-comment-<%= comment.id %> .content-form').toggle();" ><i class="fa fa-pencil"></i></a>
    <% end %>
    <% if current_user && (current_user.role == "admin" || current_user.role == "moderator" || comment.uid == current_user.uid || node.uid == current_user.uid) %>
    <a class="btn btn-default btn-sm" id="answer-<%= answer_id %>-comment-<%= comment.id %>-delete-btn" data-remote="true" data-confirm="Are you sure? <% if current_user && comment.uid != current_user.uid %>Please exercise caution in deleting/moderating others' comments; this cannot be undone.<% end %>" href="/comment/delete/<%= comment.id %>?type=question"><i class='icon fa fa-trash'></i></a>
    <% end %></p>
  </div>
  • [ ] 💾 Commit your changes

  • [ ] 🔀 Start a Pull Request. There are two ways how you can start a pull request:

  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can also edit files directly in your browser and open a pull request from there.

  • [ ] 🏁 Done Ask in comments for a review :)

🤔❓ Questions?

Leave a comment below!

Is someone else already working on this?

We encourage you to link to this issue by mentioning the issue # in your pull request, so we can see if someone's already started on it. If someone seem stuck, offer them some help! Otherwise, take a look at some other issues you can help with. Thanks!

(This issue was created by First-Timers-Bot.)

stefannibrasil avatar May 16 '18 20:05 stefannibrasil

Hi! Can I try this one? :)

Toiya avatar May 16 '18 22:05 Toiya

Yes, sure, @Toiya thanks for the help! If you have any questions, we are here to help :)

stefannibrasil avatar May 16 '18 23:05 stefannibrasil

@stefannibrasil So I made the changes and apparantly there are some issues. However, they don't seem to be in the file I changed. Is this a mistake on my part or is it an okay fix anyway? Sorry for the newbie question, I'm completely new to this

Toiya avatar May 16 '18 23:05 Toiya

Hi, @Toiya That's okay, we are all here to learn :)

Do you mean the codeclimate issues? Yeah, I don't think they are related to your changes at all.

I believe you don't have to worry about it for now, because we are still changing the files to reflect the style code that codeclimate checks, am I right, @publiclab/reviewers @jywarren ? (If not, I can help you with that, for sure).

stefannibrasil avatar May 17 '18 01:05 stefannibrasil

Thanks, Ill take a look!

jywarren avatar May 19 '18 04:05 jywarren

IS this issue still open?

ibrahimabdelkhaleq avatar May 27 '18 01:05 ibrahimabdelkhaleq

Hi @ibrahimelbanna, @Toiya is already working on this issue in pr #2733. You can try other issues. Let us know if you need any help in finding issue.

namangupta01 avatar May 27 '18 04:05 namangupta01

@namangupta01 yes I need help finding an issue for a new timer contributor.

ibrahimabdelkhaleq avatar May 27 '18 12:05 ibrahimabdelkhaleq

@namangupta01 hi, I'd like to also help out on any more issues you have for a newbie.

chanjess avatar Jun 02 '18 21:06 chanjess

@publiclab/reviewers anyone have a good first timers issue or two to share here?

Thanks everyone for helping out!

jywarren avatar Jun 03 '18 00:06 jywarren

Hi, @chanjess I made a new one here: https://github.com/publiclab/plots2/issues/2761

I made another here, although it's especially simple so if you want a tougher one i'll work on that too: https://github.com/publiclab/plots2/issues/2762

jywarren avatar Jun 03 '18 15:06 jywarren

@jywarren hey warren i'm curious about the tougher one too, no guarantee I can fix it tho :P

chanjess avatar Jun 04 '18 01:06 chanjess

well, feel free to give it a try and we can help you through it!

On Sun, Jun 3, 2018 at 7:29 PM, chanjess [email protected] wrote:

@jywarren https://github.com/jywarren hey warren i'm curious about the tougher one too, no guarantee I can fix it tho :P

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

jywarren avatar Jun 04 '18 04:06 jywarren

is anyone working on this issue? if not i will like to work on it

dewanhimanshu avatar Jul 06 '18 12:07 dewanhimanshu

is anybody working on this...?

coderjolly avatar Jul 08 '18 18:07 coderjolly

I think you're free to take it up, but please link back here from your PR as soon as you begin so we don't have 2 people working redundantly. Thanks!

jywarren avatar Jul 09 '18 14:07 jywarren

added spam-button #3016

dewanhimanshu avatar Jul 09 '18 18:07 dewanhimanshu

OK, closing this one out, thank you!!!

jywarren avatar Jul 25 '18 13:07 jywarren