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

Add "status" field to /comments page, viewable by admins/moderators only #7362

Closed
jywarren opened this issue Jan 27, 2020 · 3 comments · Fixed by #7470
Closed

Add "status" field to /comments page, viewable by admins/moderators only #7362

jywarren opened this issue Jan 27, 2020 · 3 comments · Fixed by #7470
Labels
fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet help wanted requires help by anyone willing to contribute HTML Ruby
Milestone

Comments

@jywarren
Copy link
Member

https://publiclab.org/comments has tools to spam individual comments, shown to admins, here:

<% if comment.status == 4 && current_user &. can_moderate? %>
<a class="btn btn-outline-secondary btn-sm" href="/admin/publish_comment/<%= comment.id %>"><%= translation('dashboard.moderate.approve') %></a>
<a class="btn btn-outline-secondary btn-sm" href="/admin/mark_comment_spam/<%= comment.id %>"><%= translation('dashboard.moderate.spam') %></a>
<% elsif current_user &. can_moderate? %>
<a rel="tooltip" title="Mark as spam" class="btn btn-sm btn-outline-secondary 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 %>
<a rel="tooltip" title="Flag as spam" class="btn btn-sm btn-outline-secondary 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/<% if comment.author %><%= comment.author.name %><% end %>+Thanks!">
<i class="fa fa-flag"></i>
</a>
<% end %>

Let's add a small indicator of the current status of the comment there too, as it's ambiguous!

Let's have the status shown just above lines 37 and 40 in this code excerpt, with Status: <%= comment.status %> so that we cover each possible condition.


This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting or reposting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labelled. Or, if this is not your first time, try to solve it yourself!


@jywarren jywarren added help wanted requires help by anyone willing to contribute Ruby fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet HTML labels Jan 27, 2020
@jywarren jywarren added this to the Spam! milestone Jan 27, 2020
@keshavsethi
Copy link
Member

@jywarren I have created a PR for this issue, please review

@guptadiksha307
Copy link

Hi, I'm new to open source and I would like to contribute to this issue. May I?

@SidharthBansal
Copy link
Member

There is an outstanding PR. Can you please find any other issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fto-candidate issues which are meant to be solved by first timers but aren't well-formatted yet help wanted requires help by anyone willing to contribute HTML Ruby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants