{% extends "bee_django_course/base.html" %}
{% load bee_django_course_filter %}
{% block content %}
    <div class="text-center"><h3>录播列表</h3>
    </div>

    <div>共{{ paginator.count }}个</div>
    <table class="table">
        <thead>
        <tr>
            <th></th>
            <th>学生</th>
            <th>video ID|live ID </th>
            <th>开始时间</th>
            <th>时长</th>
            <th>查看</th>

        </tr>
        </thead>
        <tbody>
        {% for live in live_list %}
            <tr>
                <td>{{ forloop.counter }}</td>
                <td>{{ live.user|get_name_detail:True|safe }}</td>
                <td>{{ live.record_video_id|default:"" }} |<br>{{ live.live_id|default:""  }}</td>
                <td>{{ live.start_time|date:"Y-m-d H:i:s" }}</td>
                <td>{{ live.get_duration_str }}</td>


                <td>
                    {% if live.record_status == '10' %}
                        <a href="{% url 'bee_django_course:live_video_detail' live_video_id=live.record_video_id %}">查看</a>
                    {% elif live.record_status == '20' %}
                        录制失败
                    {% elif live.record_status == '30' %}
                        视频过长
                    {% else %}
                        转码中
                    {% endif %}
                </td>
            </tr>

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