class Meta:
db_table = app_label + '_' + 'document'
- ordering = ['-date_modified']
+ ordering = ['-date_added']
class Media(MediaBase):
#paginate_fix {
padding: 1em 0em 0em 0em;
margin: 0em 0em -0.8em 0em;
+ }
+
+.doc_type_title {
+ padding: 0em 0em 0em 1.5em;
+ font-weight: bold;
+ font-size: 0.8125em;
+ text-align: center;
}
\ No newline at end of file
{% endblock courses %}
{% block course %}
-<div class="desk_media">
+<div class="desk_center">
{% for c in courses %}
{% for course in c.courses %}
{% for type in c.types %}
{% block chat %}
{% if room %}
-<div id="module-set" style="width: 24%">
+<div id="module-set" style="width: 22%">
{% with "Local tweeter" as title %}
{% include "teleforma/inc/chat_room.html" %}
{% endwith %}
{% load teleforma_tags %}
{% load i18n %}
-{% if course.conference.all|from_type:type %}
+{% if course.conference.all|from_course_type:type %}
<div class="course_content">
<div class="course_subtitle">
<h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Live conference"%}</h3>
</tr>
</thead>
<tbody>
- {% for conference in course.conference.all|from_type:type %}
+ {% for conference in course.conference.all|from_course_type:type %}
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
<td><a href="{% url teleforma-conference-detail conference.id %}">{{ conference.session }}</a></td>
<td><a href="{% url telemeta-profile-detail conference.professor.user.username %}" target="_blank">{{ conference.professor }}</a></td>
{% load teleforma_tags %}
{% load i18n %}
-{% if course.document.all|from_type:type %}
+{% if course.document.all|from_course_type:type %}
<div class="course_content">
<div class="course_subtitle">
<h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Documents"%}</h3>
</div>
+
+{% for doc_type in doc_types %}
+{% if course.document.all|from_doc_type:doc_type %}
+<span class="doc_type_title">{{ doc_type }}</span>
<table class="listing" width="100%">
<thead>
<tr>
</tr>
</thead>
<tbody>
- {% for document in course.document.all|from_type:type %}
+ {% for document in course.document.all|from_course_type:type %}
+ {% if document.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">
<td>{{ document.date_added }}</td>
<td align="center">{% if document.file %}<a href="{% url teleforma-document-download document.id %}"><img src="{% url telemeta-images "download.png" %}" width="16px" style="vertical-align:middle" /></a>{% endif %}</td>
</tr>
+ {% endif %}
{% endfor %}
</tbody>
</table>
+{% endif %}
+{% endfor %}
</div>
{% else %}
{% load teleforma_tags %}
{% load i18n %}
-{% if course.media.all|from_type:type %}
+{% if course.media.all|from_course_type:type %}
<div class="course_content">
<div class="course_subtitle">
<h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Passed conferences"%}</h3>
</tr>
</thead>
<tbody>
- {% for media in course.media.all|from_type:type %}
+ {% for media in course.media.all|from_course_type:type %}
{% if media.published or user.is_staff %}
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
<td><a href="{% url teleforma-media-detail media.id %}">{{ media.conference.session }}</a></td>
return _('No')
@register.filter
-def from_type(docs, type):
+def from_course_type(docs, type):
return docs.filter(course_type=type)
+
+@register.filter
+def from_doc_type(docs, type):
+ return docs.filter(type=type)
content_type = ContentType.objects.get(app_label="teleforma", model="course")
context['room'] = get_room(name=course.title, content_type=content_type,
id=course.id)
+ context['doc_types'] = DocumentType.objects.all()
return context
@method_decorator(login_required)
context = super(CoursesView, self).get_context_data(**kwargs)
context['notes'] = Note.objects.filter(author=self.request.user)
context['room'] = get_room(name='site')
+ context['doc_types'] = DocumentType.objects.all()
return context
@method_decorator(login_required)