{% extends "bee_django_course/user_base.html" %}

{% block content %}
    {#课程列表#}
    <div style="margin: 10px 0;">
        <div class="dropdown">
            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown"
                    aria-haspopup="true" aria-expanded="false">
                课程列表
                <span class="caret"></span>
            </button>
            <ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
                {% for u_c in user_course_list %}
                    <li>
                        <a href="{% url 'bee_django_course:custom_user_course_detail' u_c.id %}">{{ u_c.course.name }}</a>
                    </li>
                {% endfor %}
            </ul>
        </div>
    </div>

    <div class="text-center"><h4>{{ user_course.course.name }}</h4></div>

    <table class="table">
        <thead>
        <tr>
            {#            <th>顺序</th>#}
            {#            <th>ID</th>#}
            <th>课件</th>
            <th>状态</th>
            <th></th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        {% for e in user_course_section_list %}
            <tr>
                {#                <td>#}
                {#                    {{ e.section.coursesectionmid_set.all }}#}
                {#                </td>#}
                {#                <td>#}
                {#                    {{ e.id }}#}
                {#                </td>#}
                <td>
                    {{ e.section.name }}
                </td>
                <td>
                    {% if e.status == 0 %}
                        未开始
                    {% elif e.status == 1 %}
                        学习中
                    {% elif e.status == 2 %}
                        已通过
                    {% elif e.status == 3 %}
                        退回重修
                    {% elif e.status == 4 %}
                        已提交
                    {% endif %}
                    {% if  not e.status == 0 %}
                        <a href="{% url 'bee_django_course:custom_user_course_section_detail' pk=e.id %}">详情</a>
                    {% endif %}
                </td>
                <td>


                    {#                    {{ e.score | default:'' }}#}
                </td>
                <td>
                    {% if e.section.has_videowork %}
                        要求：{{ e.section.video_length_req }}分钟
                        {% if not e.status == 0 %}
                            已练{{ e.work_time }}分钟
                        {% endif %}
                    {% endif %}
{#                    {% if e.section.has_imagework or e.section.has_textwork %}#}
{#                        <a href="" class="btn btn-default">作业</a>#}
{#                    {% endif %}#}
                    {#                    {% if e.status == 1 %}#}
                    {#                        <a href="{% url 'bee_django_course:user_assignment' ucs_id=e.id %}" class="btn btn-default">#}
                    {#                            写作业#}
                    {#                        </a>#}
                    {#                    {% elif e.status == 2 %}#}
                    {#                        <a href="{% url 'bee_django_course:user_assignment' ucs_id=e.id %}"#}
                    {#                           class="btn btn-success">查看</a>#}
                    {#                    {% elif e.status == 3 %}#}
                    {#                        <a href="{% url 'bee_django_course:user_assignment' ucs_id=e.id %}"#}
                    {#                           class="btn btn-warning">查看</a>#}
                    {#                    {% elif e.status == 4 %}#}
                    {#                        <a href="{% url 'bee_django_course:user_assignment' ucs_id=e.id %}" class="btn btn-info">查看</a>#}
                    {#                    {% endif %}#}
                </td>

            </tr>
        {% endfor %}
        </tbody>
    </table>
    {% include 'bee_django_course/paginator.html' %}

{% endblock content %}
{% block scripts %}

{% endblock scripts %}