{% extends "bee_django_track/base.html" %}
{% load bee_django_track_filter %}

{% block content %}
    {% include 'bee_django_track/logo.html' %}
    {% include 'bee_django_track/nav.html' %}
    <div class="text-center"><h3>
        {{ user|get_name_detail:False }}的足迹
    </h3>
    </div>
    <div class="text-right">
        {% include 'bee_django_track/user/include_nav.html' %}
    </div>

    <table class="table">
        <thead>
        <tr>
            <th></th>
            <th>类型</th>
            <th>标题</th>
            <th>添加时间</th>
            <th>添加人</th>

        </tr>
        </thead>
        <tbody>
        {% for record in record_list %}
            <tr>
                <td>{{ forloop.counter }}</td>
                <td>{{ record.content_type.title }}</td>
                <td>{{ record.title }}</td>
                <td>{{ record.created_at|date:"Y-m-d H:i:s" }}</td>
                <td>{{ record.created_by|get_name_detail:False|default:"系统" }}</td>
                <td>
                    {% get_record_link request.user record as link %}
                    {% if link %}
                        <a href="{{ link }}">详情</a>
                    {% endif %}
                    {#                    <a href="{% url 'bee_django_crm:source_update' source.id %}  ">修改</a>#}
                    {#                    <a href="#" id="delete_{{ source.id }}"#}
                    {#                       data-confirm="{% url "bee_django_crm:source_delete" source.id %}"#}
                    {#                       onclick="click_del(this)">删除</a>#}
                </td>
            </tr>

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