</div>
{% for doc_type in doc_types %}
-{% if course.document.all|from_doc_type:doc_type %}
+{% if course.document.all|from_course_type:type|from_doc_type:doc_type %}
<span class="doc_type_title">{{ doc_type }}</span>
<table class="listing" width="100%">
<thead>
</tr>
</thead>
<tbody>
- {% for document in course.document.all|from_course_type:type %}
+ {% for document in course.document.all|from_course_type:type|from_doc_type:doc_type %}
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
<td>{% if document.file %}<a href="{% url teleforma-document-detail document.id %}" target="_blank">{% endif %}{{ document.title }}{% if document.file %}</a>{% endif %}</td>
<td align="center">