{% extends "base.html" %}
{% load bootstrap %}

{% block title %}
    {{ block.super }} - Your Courses
{% endblock %}

{% block docready %}
$('#id_courses').multiselect({
	 buttonClass: 'btn btn-default',
	 disableIfEmpty: true,
	 enableCaseInsensitiveFiltering: true,
     numberDisplayed: 0
});
{% endblock %}

{% block content %}
<div class="page-header">
    <h1>Your Courses</h1>
</div>

<section>
    <table class="table">
        <thead>
            <tr>
                <th>Course</th>
                <th>Owner</th>
                <th>Open Assignments</th>
            </tr>
        </thead>
        <tbody>
            {% for course in courses %}
                <tr>
                    <td><a href="{{ course.homepage }}">{{ course }}</a></td>
                    <td>{{ course.owner }}</td>
                    <td>{{ course.open_assignments|length }}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
</section>

<form class="form" role="form" action="." method="post">
	{% csrf_token %}
	{{ coursesForm }}
	<button type="submit" href="." class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> Save Changes</button>
</form>

{% endblock %}



