From 4e9d467fc0b3dfc55db15e84d5d988cefa400fa1 Mon Sep 17 00:00:00 2001 From: Jef van Schendel Date: Thu, 29 Dec 2011 22:54:31 +0100 Subject: [PATCH] Isolate JavaScript; add new show_password.js to forgot-password-page as well --- mediagoblin/auth/forms.py | 8 +------ .../templates/mediagoblin/auth/change_fp.html | 5 ++++ .../templates/mediagoblin/auth/register.html | 23 ++----------------- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/mediagoblin/auth/forms.py b/mediagoblin/auth/forms.py index 4cd3e9d8..5a707c7b 100644 --- a/mediagoblin/auth/forms.py +++ b/mediagoblin/auth/forms.py @@ -62,13 +62,7 @@ class ChangePassForm(wtforms.Form): password = wtforms.PasswordField( 'Password', [wtforms.validators.Required(), - wtforms.validators.Length(min=6, max=30), - wtforms.validators.EqualTo( - 'confirm_password', - 'Passwords must match.')]) - confirm_password = wtforms.PasswordField( - 'Confirm password', - [wtforms.validators.Required()]) + wtforms.validators.Length(min=6, max=30)]) userid = wtforms.HiddenField( '', [wtforms.validators.Required()]) diff --git a/mediagoblin/templates/mediagoblin/auth/change_fp.html b/mediagoblin/templates/mediagoblin/auth/change_fp.html index 03a6583b..e8e64023 100644 --- a/mediagoblin/templates/mediagoblin/auth/change_fp.html +++ b/mediagoblin/templates/mediagoblin/auth/change_fp.html @@ -19,6 +19,11 @@ {% import "/mediagoblin/utils/wtforms.html" as wtforms_util %} +{% block mediagoblin_head %} + +{% endblock mediagoblin_head %} + {% block mediagoblin_content %}
- $(document).ready(function(){ - $("#password").after(''); - $('#password_clear').hide(); - $('#password_boolean').click(function(){ - if($('#password_boolean').prop("checked")) { - $('#password_clear').val($('#password').val()); - $('#password').hide(); - $('#password_clear').show(); - } else { - $('#password').val($('#password_clear').val()); - $('#password_clear').hide(); - $('#password').show(); - }; - }); - $('#password,#password_clear').keyup(function(){ - $('#password').val($(this).val()); - $('#password_clear').val($(this).val()); - }); - }); - + {% endblock mediagoblin_head %} {% block mediagoblin_content %} -- 2.25.1