{% 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>共{{ paginator.count }}个</div>
    <table class="table">
        <thead>
        <tr>
            <th></th>
            {#            <th></th>#}
            <th>活动名称</th>
            <th>结束时间</th>

            <th></th>

        </tr>
        </thead>
        <tbody>
        {% for reward in reward_list %}
            <tr>
                <td>{{ forloop.counter }}</td>
                {#                <td>{% if not r.is_mk %}新用户{% endif %}</td>#}
                <td>{{ reward.title }}</td>
                <td>{{ reward.end_time }}</td>
                <td>
                    {% if perms.bee_django_crm.view_bargain_reward_detail %}
                        <a href="{% url 'bee_django_crm:campaign_record_list' %}?reward_id={{ reward.id }}">参与记录</a>
                    {% endif %}
                </td>
                <td>
                    {% if perms.bee_django_crm.view_bargain_reward_detail %}
                        <a href="{% url 'bee_django_crm:bargain_reward_detail' reward.id %}">详情</a>
                    {% endif %}
                </td>
            </tr>

        {% endfor %}
        </tbody>
    </table>
    {% 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 %}