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

{% block content %}

    <h4>{{ user_course.course.name }}</h4>

    <table class="table">
        <thead>
        <tr>
            <th>课件</th>
            <th>状态</th>
            <th>得分</th>
            <th>作业</th>
        </tr>
        </thead>
        <tbody>
        {% for e in section_list %}
            <tr>
                <td>
                    {% if e.status == 0 %}
                        {{ e.section.name }}
                    {% else %}
                        <a href="{% url 'bee_django_course:user_course_section_detail' ucs_id=e.id %}"
                           class="btn btn-default">{{ e.section.name }}</a>
                    {% endif %}
                </td>
                <td>
                    {% if e.status == 0 %}
                        未开始
                    {% elif e.status == 1 %}
                        学习中
                    {% elif e.status == 2 %}
                        已通过
                    {% elif e.status == 3 %}
                        退回重修
                    {% elif e.status == 4 %}
                        已提交
                    {% endif %}
                </td>
                <td>{{ e.score | default:'' }}</td>
                <td>
                    {% 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>


{% endblock content %}