{% extends "bee_django_course/base.html" %}
{% load bootstrap3 %}
{% block content %}
    <h4>课程详情</h4>

    <a href="{% url 'bee_django_course:section_update'  section.id %}">修改课件</a>
    <table class="table">
        <tr>
            <td class="col-xs-3">名称</td>
            <td>{{ section.name }}</td>
        </tr>
        <tr>
            <td>说明</td>
            <td>{{ section.info | safe }}</td>
        </tr>

        <tr>
            <td>要求录制时长(分钟)</td>
            <td>{{ section.video_length_req }}</td>
        </tr>
        <tr>
            <td>是否需要上传图片</td>
            <td>{% if section.has_imagework %} 是 {% else %} 否 {% endif %}</td>
        </tr>
        <tr>
            <td>要求提交图片数量</td>
            <td>{{ section.image_count_req }}</td>
        </tr>
        <tr>
            <td>已添加的附件</td>
            <td>
                {% for e in attachs %}
                    <a href="{{ e.file.url }}">
                        {{ e.file_name }}
                    </a>
                {% endfor %}
            </td>
        </tr>
        <tr>
            <td>已关联的视频</td>
            <td>
                {% for e in section.sectionvideo_set.all %}
                    <a href="#">{{ e.video.title }}</a>
                {% endfor %}
            </td>
        </tr>
    </table>

    <h4>添加关联的视频</h4>

    <form method="post" action="{% url 'bee_django_course:create_section_video' section_id=section.id %}">
        {% csrf_token %}
        {% bootstrap_form section_video_form %}
        {% bootstrap_button '提交' %}
    </form>
{% endblock %}