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 an indicator for red colored banned users and a hover over the username to check for spammers quickly #1721

Closed
5 tasks
Diksha2008 opened this issue Oct 24, 2017 · 6 comments · Fixed by #1726
Labels
enhancement explains that the issue is to improve upon one of our existing features first-timers-only They need to be well-formatted using the First-timers_Issue_Template. help wanted requires help by anyone willing to contribute HTML

Comments

@Diksha2008
Copy link
Contributor

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!

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

The problem

When you go to page:

http://localhost:3000/likes

You see something like this:

image

Here, The recent likes are listed with banned users depicted in red colour and black otherwise. There should be an indicator as to what red indicates. Secondly, a hover for admin and moderators is required over the username so that they can read peoples' bio quickly to check if they're spammers.

Solution

The changes are required to be made in the following template:

https://github.com/publiclab/plots2/blob/master/app/views/like/index.html.erb

Add the indicator for red coloured banned user in <p> tags below the heading Recent Likes in this template something like this:

<p>Username in red indicates <b><i>banned user</i></b>.</p><br>

Secondly, a hover over the username for moderators and admin only could be implemented by adding an if else condition to check for admin and moderators like this:

<% if current_user && (current_user.role == "admin" || current_user.role == "moderator") %>

<a rel="tooltip" title="<%= like.user.bio %>" class="user" href="/profile/<%= like.user.name %>" style = "color: <%= like.drupal_users.status.zero? ? 'red' : 'black' %>"" > <i class="fa fa-user" aria-hidden="true"></i> <%= like.user.name %></a>

<% else %>

<a href="/profile/<%= like.user.name %>" style = "color: <%= like.drupal_users.status.zero? ? 'red' : 'black' %>"><i class="fa fa-user" aria-hidden="true"></i> <%= like.user.name %></a>

<% end %>

replacing this line of code

<a href="/profile/<%= like.user.name %>" style = "color: <%= like.drupal_users.status.zero? ? 'red' : 'black' %>"> <i class="fa fa-user" aria-hidden="true" style = "color: <%= like.drupal_users.status.zero? ? 'red' : 'black'%>"></i> <%= like.user.name %></a>

Steps to Fix

  • claim this issue with a comment here, below, and ask any clarifying questions you need
  • set up a repository locally following the README instructions, and make sure that all tests pass
  • try to fix the issue following the steps above, but even before you're done, you can:
  • commit your changes and start a pull request (see contributing to Public Lab software) but mark it as "in progress" if you have questions or if you haven't finished
  • alert someone via the developers list (see below) to have your pull request merged. This may take a few extra steps depending on when you do it, but we'll help you out!

Please email the developers list (see https://publiclab.org/wiki/developers) or go to the chatroom if you have questions, and take a look at our first-timers landing page for more information!

@jywarren
Copy link
Member

This looks great, thanks so much!!! 🎉

@jywarren jywarren added enhancement explains that the issue is to improve upon one of our existing features first-timers-only They need to be well-formatted using the First-timers_Issue_Template. hacktoberfest help wanted requires help by anyone willing to contribute HTML labels Oct 24, 2017
@jywarren
Copy link
Member

@sagarpreet-chadha - if you're interested in doing one of these as well, take a look here, it's worthwhile and very exciting when someone shows up to try to solve the issue :-)

@ebarry
Copy link
Member

ebarry commented Oct 24, 2017

Wow @Diksha2008 this is a really super first-timers-only issue -- i wish i could write these as well as you can!!!!!

@sagarpreet-chadha
Copy link
Contributor

sagarpreet-chadha commented Oct 25, 2017

@jywarren sir...Yes sir , I would love to make these ! Thanks !

@ViditChitkara
Copy link
Member

ViditChitkara commented Oct 25, 2017

@jywarren if this is open could I work on it?
@Diksha2008 are you already working on it?

@Diksha2008
Copy link
Contributor Author

@ViditChitkara No, I am not working on it! you can go ahead with it!

ViditChitkara added a commit to ViditChitkara/plots2 that referenced this issue Oct 25, 2017
ViditChitkara added a commit to ViditChitkara/plots2 that referenced this issue Oct 25, 2017
jywarren pushed a commit that referenced this issue Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement explains that the issue is to improve upon one of our existing features first-timers-only They need to be well-formatted using the First-timers_Issue_Template. help wanted requires help by anyone willing to contribute HTML
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants