{% extends "bee_django_crm/base.html" %}
{% load bee_django_crm_filter %}

{% block content %}
    {% include 'bee_django_crm/logo.html' %}
    {% include 'bee_django_crm/nav.html' %}
    {% include 'bee_django_crm/messages.html' %}
    {% include 'bee_django_crm/preuser/preuser_nav.html' %}

    {% if perms.bee_django_crm.add_preuser %}
        <div class="text-right" style="margin: 10px;">
            <a class="btn btn-default" href="{% url 'bee_django_crm:preuser_add' %}">添加crm用户</a>
        </div>
    {% endif %}

    {% include 'bee_django_crm/preuser/preuser_search.html' %}
    <div>共{{ paginator.count }}人</div>
    {% if level == '1' %}
        {% include 'bee_django_crm/preuser/preuser_list_1.html' %}
    {% elif level == '2' %}
        {% include 'bee_django_crm/preuser/preuser_list_2.html' %}
    {% elif level == '3' %}
        {% include 'bee_django_crm/preuser/preuser_list_3.html' %}
    {% elif level == '4' %}
        {% include 'bee_django_crm/preuser/preuser_list_4.html' %}
    {% else %}
        {% include 'bee_django_crm/preuser/preuser_list_0.html' %}
    {% endif %}
    {% include 'bee_django_crm/paginator.html' %}
{% endblock %}
{% block scripts %}
    <script>
        function click_del(_this) {
            if (!confirm('确认要执行这个操作？')) {
                return false;
            }
            var url = $(_this).attr('data-confirm');
            $.post(url).done(function (data) {
                alert('删除成功!');
                location.reload();
            });
        }
    </script>
{% endblock %}