Plots2: Make spamaway ids unique

Created on 9 Mar 2019  路  11Comments  路  Source: publiclab/plots2

Our spamaway system shows these nice emoji to prevent spammers:

https://publiclab.org/signup?spamaway=true (if you're not logged in)

The code is here:

https://github.com/publiclab/plots2/blob/3d74756c6f7a1ef43dd412c06c2aba9923c98026/app/views/users/_spamaway.html.erb#L19-L21

However, we're getting a warning now that since this is loaded multiple times per page, this segment is causing a collision of identical CSS ids:

image

I think we have to replumb it using classnames to get rid of this warning.

I /think/ we can potentially change these lines:

https://github.com/publiclab/plots2/blob/3d74756c6f7a1ef43dd412c06c2aba9923c98026/app/views/users/_spamaway.html.erb#L19-L21

They're currently rendering like this, and you can see the id="spamaway_statement1_" that's causing the problem. But i think it may not be important to the functioning of the system, because the name field is the important part of a form. The

<button type="button" class="col-xs-5 btn btn-default" style="font-size:3em;text-align:left;" id="spamaway-00">
--
聽 | <input type="radio" value="馃摶" name="spamaway[statement1]" id="spamaway_statement1_" /> 馃摶
聽 | </button>

The above radio_button line is part of the form helpers in Rails: https://guides.rubyonrails.org/form_helpers.html

Can we maybe pass in something to the radio_button method to give a more unique id?

bug has-pull-request help wanted

All 11 comments

Can I please work on this issue?

Hey @divyabaid16 there's this isuue that's already assigned to you. Mind if i work on this one?

hey @GettyOrawo, you can start working on this as @divyabaid16 has started with #4971 as per their comment . You both can also work on this together, totally up to you. Thanks!

How's the work going in on this one @GettyOrawo ? Checking in to see if you need any help!

Hey @GettyOrawo are you still working on this one?

Hi Is this issue available @gauravano ?

yes @CleverFool77!

I would like to work on this. @gauravano
thanks !!

Great!

Hi @gauravano I opened a PR https://github.com/publiclab/plots2/pull/5465 for this issue.
thanks !!!

Reviewing!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jywarren picture jywarren  路  3Comments

milaaraujo picture milaaraujo  路  3Comments

keshavsethi picture keshavsethi  路  3Comments

grvsachdeva picture grvsachdeva  路  3Comments

bronwen9 picture bronwen9  路  3Comments