-
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
Add button to report answers spams to Comments upon Answers #2733
Conversation
Generated by 🚫 Danger |
<a rel="tooltip" title="Flag as spam" class="btn btn-sm btn-default btn-flag-spam-<%= comment.id %>" href="mailto:moderators@publiclab.org?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)%> |
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.
hi @Toiya , changes are looking great! Could you please attach a screenshot of the updated view? 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.
I'm a little unsure if this is what you want but here are three screenshots of the flag button created, if I understand correctly. As you can see in the third one with the email, the words are currently seperated by plus-signs, which I guess is not what we want. I could try to fix this with my semi-limited HTML-skills, if you want to :)
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.
hi @Toiya, actually, these are the screenshot of the dashboard I guess and the flag is already implemented there. Changes from your code should appear in a question's comment. So, first you need to install plots2 and after that run localhost, and generate a question. After generating the question, generate test comments on that. And, with each of those comments, you should be able to see a flag button.
If you have not installed plots2 repo, then we can help you in installation. You can ask us anytime. 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.
Hello! Sorry for getting it wrong, and thank you for being so patient. I'm currently following the installation guide in the README, but I'm stuck on step 4. Do you want me to rename db/schema.rb.example to db/schema.rb? Since they are both files, I don't understand how I'm supposed to make a copy of a file and place it "at" another file. Again, thank you so much for your patience!
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.
You should be able to delete the existing db/schema.rb and replace it with a copy of the example file. Sorry that wasn't as clear as it could be!
It's absolutely fine, take your time with issue. Yes, you can rename it,
that would work. And, don't bother in asking any doubt. Thanks.
Gaurav Sachdeva
…On 18-May-2018 12:34 AM, "Toiya" ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In app/views/questions/_comment.html.erb
<#2733 (comment)>:
> @@ -26,7 +26,10 @@
</div>
<div class="inline pull-xs-right" style="vertical-align: top">
- <p><% if answer_id == 0 && current_user && (current_user.role == "admin" || current_user.role == "moderator" || comment.uid == current_user.uid)%>
+ <a rel="tooltip" title="Flag as spam" class="btn btn-sm btn-default btn-flag-spam-<%= comment.id %>" ***@***.***?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)%>
Hello! Sorry for getting it wrong, and thank you for being so patient. I'm
currently following the installation guide in the README, but I'm stuck on
step 4. Do you want me to rename db/schema.rb.example to db/schema.rb?
Since they are both files, I don't understand how I'm supposed to make a
copy of a file and place it "at" another file. Again, thank you so much for
your patience!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2733 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AT6S9pegyJJ_HBNMqG_C_xeYaH7vxMPqks5tzcmugaJpZM4UCL-x>
.
|
Hi again, sorry for the delay! I've been trying to install plots2 but when I get to point 3: "Install gems with 'bundle install --without production mysql' ", I get an error when the installer gets to libv8. I've been looking around for a fix but I can't seem to find anything. Below is the full error message:
and if I run
followed by a lot of lines where it seems to try and fix it, but then it ends up with
Sorry for my messy way of trying to explain the problem. I'm very grateful for any help I can get! |
hi @Toiya, I found this on stack-overflow https://stackoverflow.com/questions/19673714/error-installing-libv8-error-failed-to-build-gem-native-extension . Would you like to try? |
Hi @Gauravano! Thank you for your quick response. After having tried all the relevant fixes (i.e. excluding the ones using homebrew since I'm on Windows) from the Stack Overflow thread, some of them similar to what I've already tried, nothing still seems to be working. I'll keep looking around and will give you an update if I find a solution |
Hmm, I guess @jywarren or @publiclab/reviewers could help us. |
Hi, I think you should be able to comment out that gem in the Gemfile, and try again. I'm not sure why it's not working -- what operating system and version are you using? But that gem is for testing JavaScript and those tests usually aren't run locally anyways. |
Hi! I'm using Windows 10 version 1709, which might be an issue since from what I understand after reading countless Stack Overflow threads, rails development in Windows can be quite problematic. I've previously used Bash on Ubuntu on Windows for this issue, but as all else has failed I retried the whole installation process with Git Shell (Windows Powershell), but the problem is still there. There is also no gem in Gemfile with either libv8 or v8, but that might just be me misunderstanding which gem to comment out. I tried commenting out therubyracer instead since that seems to be part of the problem, but Less requires that and if I then comment out Less (really trying everything now haha), it still doesn't work. I've checked for information on Windows support in the repo for libv8 here: rubyjs/libv8#217 and it's ironic because what they're suggesting is using Bash on Ubuntu on Windows. Again, thank you guys so much for all the patience and guidance and for being so welcoming to beginners like me! It is very, very appreciated :) |
hi @Toiya sorry for the delay, my exams are going on so can't run this. Running your code now. Also, I found an article on gorails about starting rails development on windows, see if it may help https://gorails.com/setup/windows/10 . Thanks. |
Hi @Toiya -- thanks for sticking with this! I do think doing this on Windows may be a tough one... I think Some clues here: rubyjs/libv8#29 and something promising here: https://stackoverflow.com/questions/16514758/gem-install-libv8-version-3-11-8-17-on-ruby-windows it recommends:
That may assume you have the v8 library installed though! But see the libv8 library link above to see about that. This may also be an alternative: https://github.com/eakmotion/therubyracer_for_windows I hope some of this helps! I don't have windows myself and I'm sorry it has been frusturating. The other thing is that if you want to just complete this PR we can take the screenshots for you. But we're hoping to help you get the system installed so that you can contribute more with us! Thanks for your hard work and patience!!! |
Hi!
and when trying to open localhost:3000 in browser it gives an "ERR_CONNECTION_REFUSED". Having viewed this: https://stackoverflow.com/questions/999532/passenger-on-windows, I'm thinking of just getting rid of Windows and get Ubuntu instead, which is something I have thought of for a while and would probably have done in the future anyways. For personal reasons, that will have to wait a few days tho, but I'll give you an update once that's done. Having seen how great you've been through all of this, I'd love to keep contributing in the future! Thank you so much :) |
hi @Toiya, thanks for trying so hard, could you try |
Awesome @Toiya ! Thanks for going from all troubles. Reviewing your PR. Thanks. |
<a rel="tooltip" title="Flag as spam" class="btn btn-sm btn-default btn-flag-spam-<%= comment.id %>" href="mailto:moderators@publiclab.org?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)%> |
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.
Code seems fine ..
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.
Do you think we can do some changes to make view cleaner by aligning all three buttons in a line? Actually, the delete button is visible to you because you are currently logged in as 'moderator' from localhost. And, I think as moderator already has the power to delete the comment, so flag option is not needed for moderator and admin. So, here's what you can do -
-
Add if statement so that button will appear only if the current user is not admin or moderator. The if statement would look something like this-
!current_user || current_user.role != "admin" && current_user.role != "moderator"
-
Paste the screenshot logging in as user and moderator, and view without logging in.
Thanks!
just want to say AMAZING folks!!! Thanks and great work!!!!
…On Thu, May 31, 2018 at 4:53 AM, Gaurav Sachdeva ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In app/views/questions/_comment.html.erb
<#2733 (comment)>:
> @@ -26,7 +26,10 @@
</div>
<div class="inline pull-xs-right" style="vertical-align: top">
- <p><% if answer_id == 0 && current_user && (current_user.role == "admin" || current_user.role == "moderator" || comment.uid == current_user.uid)%>
+ <a rel="tooltip" title="Flag as spam" class="btn btn-sm btn-default btn-flag-spam-<%= comment.id %>" ***@***.***?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)%>
Do you think we can do some changes to make view cleaner by aligning all
three buttons in a line? Actually, the delete button is visible to you
because you are currently logged in as 'moderator' from localhost. And, I
think as moderator already has the power to delete the comment, so flag
option is not needed for moderator and admin. So, here's what you can do -
1.
Add if statement so that button will appear only if the current user
is not admin or moderator. The if statement would look something like this- !current_user
|| current_user.role != "admin" && current_user.role != "moderator"
2.
Paste the screenshot logging in as user and moderator, and view
without logging in.
Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2733 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABfJwNpUGWS6Fqc-Uy0xB25u0ubeWTnks5t36-PgaJpZM4UCL-x>
.
|
Hi @Toiya , this PR is very close to completion, do you want any help with this ? Thanks. |
Hi, just checking if you've gotten stuck on this at all, or if I could help in any way? Thanks! |
* Notifications field added in users * Rails migration rollback and new migration added * Migrations corrected * Added documentation * Two migrations merged into one
* improve UI of digest email * minor changes * added links to settings and subscriptions
* move emoji.js from public/lib/ to public/ * update path to emoji.js
Bumps [jbuilder](https://github.com/rails/jbuilder) from 2.7.0 to 2.8.0. - [Release notes](https://github.com/rails/jbuilder/releases) - [Changelog](https://github.com/rails/jbuilder/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/jbuilder/commits) Signed-off-by: dependabot[bot] <support@dependabot.com>
Bumps [sidekiq](https://github.com/mperham/sidekiq) from 5.2.2 to 5.2.3. - [Release notes](https://github.com/mperham/sidekiq/releases) - [Changelog](https://github.com/mperham/sidekiq/blob/master/Changes.md) - [Commits](sidekiq/sidekiq@v5.2.2...v5.2.3) Signed-off-by: dependabot[bot] <support@dependabot.com>
* Bump rubocop from 0.52.1 to 0.60.0 Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.52.1 to 0.60.0. - [Release notes](https://github.com/rubocop-hq/rubocop/releases) - [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md) - [Commits](rubocop/rubocop@v0.52.1...v0.60.0) Signed-off-by: dependabot[bot] <support@dependabot.com> * Update .rubocop.yml
+<em class="italics"><a href="/tags">Tags</a> organize our knowledge base. Click to learn more or subscribe to a topic.</em>
* Handle case in which node doesn't exist * Remove check for node.body * Fix SQL injection in the Node.exists
* Added is_verified column to users with default value false * added helper functions for generation and validation of tokens * Delete 20181103114645_add_is_verified_to_users.rb * Minor code fixes * Added tests for implemented helper functions * Added failing tests for helper functions * Added test to make sure that a token is not validated 24 hours after gen * Code quality changes
* Update _advanced_tagging.html.erb * Update tagging.js * Update show.html.erb * Update show.html.erb * Update tagging.js
Bumps [passenger](https://github.com/phusion/passenger) from 5.3.5 to 5.3.6. - [Release notes](https://github.com/phusion/passenger/releases) - [Changelog](https://github.com/phusion/passenger/blob/stable-5.3/CHANGELOG) - [Commits](phusion/passenger@release-5.3.5...release-5.3.6) Signed-off-by: dependabot[bot] <support@dependabot.com>
* Split create function into two login paths * Ensure preservation of return_to through OAuth login flow (#3884)
Hi everyone, as we don't render question's comment from questions/_comment and use notes/_comment instead so I am going to close this PR now. Although, I would like to thank 🥇 💯 @Toiya for the work done and I hope that it was learning experience for her too. Thank you! |
Also, your branch got little disrupted by me during rebase sorry for that, but you can clean it, by running these commands Running the above commands will clean up the branch. Also, if you are interested, you can raise the same fix against this file |
Thank you @Toiya and @gauravano for your work on this. It's much appreciated!!! |
Fixes #2732