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()])
{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
+{% block mediagoblin_head %}
+ <script type="text/javascript"
+ src="{{ request.staticdirect('/js/show_password.js') }}"></script>
+{% endblock mediagoblin_head %}
+
{% block mediagoblin_content %}
<form action="{{ request.urlgen('mediagoblin.auth.verify_forgot_password') }}"
{% import "/mediagoblin/utils/wtforms.html" as wtforms_util %}
{% block mediagoblin_head %}
- <script>
- $(document).ready(function(){
- $("#password").after('<input type="text" value="" name="password_clear" id="password_clear" /><label><input type="checkbox" id="password_boolean" />Show password</label>');
- $('#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());
- });
- });
- </script>
+ <script type="text/javascript"
+ src="{{ request.staticdirect('/js/show_password.js') }}"></script>
{% endblock mediagoblin_head %}
{% block mediagoblin_content %}