{% 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' %}
    <div class="text-center"><h3>
        海报列表
    </h3>
    </div>
    {#    <div class="text-right">#}
    {#        <a class="btn btn-default" href="{% url 'bee_django_crm:poster_create' %}">添加海报</a>#}
    {#    </div>#}
    <div>共{{ paginator.count }}个</div>
    <table class="table">
        <thead>
        <tr>
            <th></th>
            <th>名称</th>
            <th>是否显示</th>
            <th></th>

        </tr>
        </thead>
        <tbody>
        {% for poster in poster_list %}
            <tr>
                <td>{{ forloop.counter }}</td>
                <td>{{ poster.source.name }}</td>
                <td>{{ poster.get_is_show }}</td>
                <td>
                    <a href="{% url 'bee_django_crm:poster_detail' poster.id %}  ">详情</a>
                    <a href="{% url 'bee_django_crm:poster_update' poster.id %}  ">修改</a>

                </td>
            </tr>

        {% endfor %}
        </tbody>
    </table>
    {% include 'bee_django_crm/paginator.html' %}
{% endblock %}
{% block scripts %}
    <script>
        function click_clear(_this) {

            if (!confirm('确认要清空图片文件，并修改为不显示？')) {
                return false;
            }
            var url = $(_this).attr('data-confirm');
            $.post(url).done(function (data) {
                alert('清除成功!');
                location.reload();
            });

        }
    </script>
{% endblock %}