23
23
< div class ="site-container ">
24
24
< h1 class ="page-title "> Create an account on PyPI</ h1 >
25
25
26
- < form method ="POST " action ="{{ request.current_route_path() }} ">
26
+ < form method ="POST " action ="{{ request.current_route_path() }} " data-controller =" password password-match " >
27
27
< input name ="csrf_token " type ="hidden " value ="{{ request.session.get_csrf_token() }} ">
28
28
29
29
{% if form.errors.__all__ %}
@@ -70,7 +70,7 @@ <h1 class="page-title">Create an account on PyPI</h1>
70
70
{% endif %}
71
71
</ div >
72
72
73
- < div data-controller =" password " >
73
+ < div >
74
74
< div class ="form-group ">
75
75
< div class ="split-layout ">
76
76
< label for ="password " class ="form-group__label "> Password</ label >
@@ -81,7 +81,7 @@ <h1 class="page-title">Create an account on PyPI</h1>
81
81
</ div >
82
82
{# the password field needs to be wrapped in a div to properly place tooltips #}
83
83
< div >
84
- {{ form.new_password(placeholder="Select a password", required="required", class_="form-group__input", autocomplete="new-password", data_target="password.password") }}
84
+ {{ form.new_password(placeholder="Select a password", required="required", class_="form-group__input", autocomplete="new-password", data_target="password.password password-match.passwordMatch", data_action="keyup- > password-match#checkPasswordsMatch ") }}
85
85
</ div >
86
86
{% if form.new_password.errors %}
87
87
< ul class ="form-errors ">
@@ -95,7 +95,7 @@ <h1 class="page-title">Create an account on PyPI</h1>
95
95
96
96
< div class ="form-group ">
97
97
< label for ="password_confirm " class ="form-group__label "> Confirm Password</ label >
98
- {{ form.password_confirm(placeholder="Confirm password", required="required", class_="form-group__input", data_target="password.password") }}
98
+ {{ form.password_confirm(placeholder="Confirm password", required="required", class_="form-group__input", data_target="password.password password-match.passwordMatch", data_action="keyup- > password-match#checkPasswordsMatch ") }}
99
99
{% if form.password_confirm.errors %}
100
100
< ul class ="form-errors ">
101
101
{% for error in form.password_confirm.errors %}
@@ -106,11 +106,15 @@ <h1 class="page-title">Create an account on PyPI</h1>
106
106
</ div >
107
107
</ div >
108
108
109
+ < ul class ="form-errors ">
110
+ < li data-target ="password-match.matchMessage " class ="hidden "> </ li >
111
+ </ ul >
112
+
109
113
< div class ="form-group ">
110
114
{{ recaptcha_html(request, form) }}
111
115
</ div >
112
116
113
- < input type ="submit " value ="Create Account " class ="button button--primary ">
117
+ < input type ="submit " value ="Create Account " class ="button button--primary " data-target =" password-match.submit " >
114
118
</ form >
115
119
</ div >
116
120
</ section >
0 commit comments