Plots2: Add an indicator for red colored banned users and a hover over the username to check for spammers quickly

Created on 24 Oct 2017  ·  6Comments  ·  Source: publiclab/plots2

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:
````ruby
<% if current_user && (current_user.role == "admin" || current_user.role == "moderator") %>

<% else %>

<%= like.user.name %>

<% end %>
````
replacing this line of code https://github.com/publiclab/plots2/blob/3955e17ad30eda37854d97d7813a862060d2bbfd/app/views/like/index.html.erb#L16

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!

HTML enhancement first-timers-only help wanted

All 6 comments

This looks great, thanks so much!!! 🎉

@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 :-)

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

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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grvsachdeva picture grvsachdeva  ·  3Comments

RuthNjeri picture RuthNjeri  ·  3Comments

noi5e picture noi5e  ·  3Comments

bronwen9 picture bronwen9  ·  3Comments

keshavsethi picture keshavsethi  ·  3Comments