Add unique class to custom field wrappers (PR #8193)

This makes hiding custom fields with CSS at signup much more reliable.

GitHub

You’ve signed the CLA, awesomerobot. Thank you! This pull request is ready for review.

Didn’t expect to run into this again so quickly, but like @SamSaffron said on https://github.com/discourse/discourse/pull/8118… a helper that can turn a string into a clean class name is probably a good idea?

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/site-setting-to-hide-custom-user-fields-from-signup-page/130990/3

@awesomerobot does Ember.String.dasherize not work?

We could use dasherize, I was being a little more cautious by also eliminating some common special characters.

If I called my field “car:model” .car:model wouldn’t work in CSS, it would have to be escaped .car\:model.

Sounds good.