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

Make spamaway ids unique #4966

Closed
jywarren opened this issue Mar 9, 2019 · 11 comments · Fixed by #5465
Closed

Make spamaway ids unique #4966

jywarren opened this issue Mar 9, 2019 · 11 comments · Fixed by #5465
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed has-pull-request issues which already have a pull request solving it help wanted requires help by anyone willing to contribute

Comments

@jywarren
Copy link
Member

jywarren commented Mar 9, 2019

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:

<button type="button" class="col-xs-5 btn btn-default" style="font-size:3em;text-align:left;<% if i.odd? %> background:#eef;<% end %>" id="spamaway-<%= i.to_s + j.to_s %>">
<%= spam.radio_button vars[i], statement %> <%= statement %>
</button>

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:

<button type="button" class="col-xs-5 btn btn-default" style="font-size:3em;text-align:left;<% if i.odd? %> background:#eef;<% end %>" id="spamaway-<%= i.to_s + j.to_s %>">
<%= spam.radio_button vars[i], statement %> <%= statement %>
</button>

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?

@jywarren jywarren added bug the issue is regarding one of our programs which faces problems when a certain task is executed help wanted requires help by anyone willing to contribute labels Mar 9, 2019
@divyabaid16
Copy link
Contributor

Can I please work on this issue?

@GettyOrawo
Copy link
Contributor

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

@grvsachdeva
Copy link
Member

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!

@IshaGupta18
Copy link
Collaborator

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

@IshaGupta18
Copy link
Collaborator

Hey @GettyOrawo are you still working on this one?

@CleverFool77
Copy link
Member

Hi Is this issue available @gauravano ?

@grvsachdeva
Copy link
Member

yes @CleverFool77!

@CleverFool77
Copy link
Member

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

This was referenced Apr 12, 2019
@grvsachdeva
Copy link
Member

Great!

@CleverFool77
Copy link
Member

Hi @gauravano I opened a PR #5465 for this issue.
thanks !!!

@grvsachdeva grvsachdeva added the has-pull-request issues which already have a pull request solving it label Apr 21, 2019
@grvsachdeva
Copy link
Member

Reviewing!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug the issue is regarding one of our programs which faces problems when a certain task is executed has-pull-request issues which already have a pull request solving it help wanted requires help by anyone willing to contribute
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants