{% extends 'base.html' %}
{% block nav_content %}
    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse navbar-ex1-collapse">
        <ul class="nav navbar-nav" id="navbar-1">
            <li id="0"><a href="/stu/index/{{ sid }}/" class="href">选课页面</a></li>
            <li id="1"><a href="/stu/selected/{{ sid }}/" class="href">已选课程</a></li>
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">学生<b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li><a href="/">退出</a></li>
                </ul>
            </li>
        </ul>
    </div><!-- /.navbar-collapse -->
{% endblock %}
{% block main_content %}
    <div class="row">
        {% for course in courses %}
            <div class="col-md-4 col-sm-6">
                <div class="thumbnail">
                    <img style="height: 200px; width: 100%; display: block;"
                         src="/static/img/{{ course.course_name }}.jpg">
                    <div class="caption">
                        <h3>{{ course.course_name }}</h3>
                        <p>{{ course.class_hour }}学时 {{ course.points }}学分</p>
                        <p>{{ course.course_brief }}</p>
{#                        新增退课#}
                        <form action="#" method="post">
                            {% csrf_token %}
                            <div class="form-group">
                                <input type="text" name="sid" value="{{ sid }}" hidden>
                                <input type="text" name="cid" value="{{ course.id }}" hidden>
                                <input type="submit" class="btn btn-primary" value="退选">
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        {% endfor %}
    </div>
{% endblock %}