{% extends "bee_django_crm/base.html" %}
{% load bee_django_crm_filter %}
{% block styles %}
    <style>
        body {
            background-color: #1A3440;
        }

        .app_title {
            background-color: #6A90A1;
            padding: 10px;
            color: #ffffff;
        }

        .app_body {
            background-color: #ffffff;
            padding: 20px;
        }
    </style>
{% endblock %}
{% block content %}
    <div class="app_title text-center"><h4>申请表</h4></div>
    <div class="app_body">
        <form method="post" action="{% url 'bee_django_crm:preuser_application_add' preuser_id %}">
            {% csrf_token %}
            <div>
                {% for application in application_list %}
                    <div>{{ application|get_html:forloop.counter|safe }}</div>
                    <hr>
                {% endfor %}
            </div>
            <input type="hidden" name="preuser_id" value="{{ preuser_id }}">

            <div class="text-center">
                <input type="submit" value="下一步"/>
            </div>
        </form>
    </div>
{% endblock %}


{% block scripts %}
    <script>
        $(document).ready(function () {

        });
        function click_() {
            var $form = $("form");
            $form.submit();
{#            var all_required = $("[bee_required]");#}
{#            var check_list = [];#}
{#            $.each(all_required, function (i, v) {#}
{#                var input_name = $(v).attr("name");#}
{#                if ($.inArray(input_name, check_list) < 0) {#}
{#                    check_list.push(input_name)#}
{#                }#}
{#            });#}

{#            $.each(check_list, function (i, input_name) {#}
{#                var _val = $("input[name=" + input_name + "]:checked").val();#}
{#                var name = $("input[name=" + input_name + "]").parent().val();#}
{#                console.log(_val);#}
{#                if (!_val) {#}
{#                    alert("请填写问题:"+name);#}
{#                    return;#}
{##}
{#                }#}
{#                console.log('=')#}
{#                $form.submit();#}
{#            });#}


        }
    </script>
{% endblock %}