{% extends theme("layout.html") %}
{% block head %}
    {{ super() }}

    <style type="text/css">

        label>span {
            color: deepskyblue;
        }

        .btn,
        .content-box,
        .form-group>div>div,
        .form-control {
            border-radius: 0 !important;
        }

        .form-horizontal > .form-group {
            margin: 0;
        }

        html,body {
            height: 100%;
        }

        .page-box .server-message {
            padding: 35px 0;
        }
        body {
            overflow: hidden;
        }
    </style>
{% endblock head %}
{% block body %}
<script type="text/javascript">
    $(document).ready(function() {
        $('body').addClass('add-transition');
        $('.add-page-transition').on('click', function(){
            var transAttr = $(this).attr('data-transition');
            $('.add-transition').attr('class', 'add-transition');
            $('.add-transition').addClass(transAttr);
        });

        $('#reset_password_form').formValidation({
            framework: 'bootstrap4',
            icon: {
                valid: 'fa fa-check',
                invalid: 'fa fa-times',
                validating: 'fa fa-refresh'
            },
            // Since the Bootstrap Button hides the radio and checkbox
            // We exclude the disabled elements only
            excluded: ':disabled',
            locale: 'zh_CN',
            fields: {
                password: {
                    validators: {
                        notEmpty: {
                        },
                        stringLength: {
                            min: 6,
                            max: 128
                        }
                    }
                }
            }
        })
        .on('success.field.fv', function(e, data) {
            if (data.fv.getInvalidFields().length > 0) {    // There is invalid field
                data.fv.disableSubmitButtons(true);
            }
        })
    });

</script>
<div class="center-vertical">
    <div class="center-content row wow">
        <form id="reset_password_form" class="col-md-4 col-sm-5 col-xs-11 col-lg-3 center-margin" action="/reset_password/{{ token }}" method="post">
            <h3 class="text-center pad25B font-primary" style="font-family: 'serif'; opacity: 0.83; font-size: -webkit-xxx-large;">设置新密码</h3>
            <div id="login-form" class="content-box bg-default">
                <div class="content-box-wrapper pad20A">
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon addon-inside bg-gray">
                                <i class="glyph-icon icon-lock"></i>
                            </span>
                            <input type="password" class="form-control" id="password" name="password" placeholder="新密码">
                        </div>
                    </div>
                    <div class="form-group" style="margin-bottom: 10px;">
                        <button type="submit" id="login_submit" class="btn btn-block btn-primary" disabled>下一步</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
{% endblock body %}
