new-day-international / reddit

New Day fork of the code that powers reddit.com
Other
3 stars 1 forks source link

Login/Registration Form Visual Validation #230

Open caseydriscoll opened 10 years ago

caseydriscoll commented 10 years ago

Transfering this from (Visual Bugs)[https://github.com/new-day-international/reddit/issues/219]

This one is a mess. I don't think it will be too hard, but is more than just a simple visual (html/css) tweak. It also adds new functionality.

Currently on http://lightnet.is, all login validation responds with the same "invalid password, real name ID, or email" error field.

image

That right sidebar box is constructed with loginformwide.html, but there is no clear script or markup that explains how it connects to the validator or where the error responses come from. It just has

<%namespace file="utils.html" import="error_field"/>

at the top, the errors aren't in the file itself. The spec requires that the .has-error class is added to the input field with the error. This is a problem on two fronts.

If I remember correctly, the entire login process is ajax, so you should be able to easily add a callback function to append the class, but how you know which field to append to is unknown (at least, i dont know).

Currently for the right sidebar, the error is rendered twice, out of place and out of style. It should be relatively easy to fix, depending on the desired outcome, you just need to add the appropriate alert/label class to the html. After digging for about 15 min though, it wasn't clear how the message is rendered.

image

image

There are more problems.The /login form also exists, and looks passable right now. But I believe it uses a completely different template (login.html?) and I think the solution above will have to be reengineered for this template.

Lastly, if a user clicks on "register" on the top right, they get the same form as on /login. Again, I think if you complete the issue in the previous paragraph it will fix validation and formatting on this too.