{% extends "bee_django_crm/base.html" %}
{% load bee_django_crm_filter %}
{% load bootstrap3 %}
{% block content %}
    {% include 'bee_django_crm/logo.html' %}
    {% include 'bee_django_crm/nav.html' %}

    {% if is_user_agree %}
        <h4>提交成功，请等待客服确认</h4>
    {% else %}
        {{ contract.agreement|safe|default:"" }}

        <div style="margin: 10px auto;">
            <form method="post" action="{% url "bee_django_crm:preuser_contract_agreement" preuser_contract_id %}">
                {% csrf_token %}
                {% bootstrap_form form %}
        {% bootstrap_button '提交' %}

{#                {{ form.is_user_agree.errors }}#}
                {##}
                {#                {{ form.is_user_agree }} 我同意以上协议#}
{#                <div style="margin: 10px auto;"><input type="submit" value="提交" class="btn btn-success"/></div>#}
            </form>


            {#        <input type="checkbox" id="agree_checkbox">我同意以上条款</div>#}
            {#    <div>#}

            {#                <button class="btn btn-success">下一步</button>#}
            {#        <a href="#"#}
            {#           data-confirm="{% url "bee_django_exam:user_exam_notice" user_id grade.id %}"#}
            {#           onclick="click_next_btn(this)" class="btn btn-success">下一步</a>#}
        </div>
    {% endif %}

{% endblock %}
{% block scripts %}
    <script>
        {#        function click_next_btn(_this) {#}
        {#            var agree = $('#agree_checkbox').is(':checked');#}
        {#            if (!agree) {#}
        {#                alert("请勾选同意该条款");#}
        {#                return;#}
        {#            }#}
        {#            location.href = "{% url 'bee_django_exam:user_exam_record_add' user_id %}";#}
        {#            var url = $(_this).attr('data-confirm');#}
        {#            console.log(url)#}
        {#            $.post(url).done(function (data) {#}
        {#            });#}
        {##}
        {##}
        {#        }#}
    </script>
{% endblock %}