font-size: 0.9125em;
background-color: #FFF;
color: #0000 ;
- font-weight: normal;
+ font-weight: bold;
max-height: 250px;
overflow-y: scroll;
margin-top: 0.8em;
}
+.course_subtitle {
+ padding: 0.3em;
-.course_content h2 {
- padding: 0.5em 0.8em 0.8em 0.8em;
- }
+}
.course_content p {
padding: 0.5em 0.8em 0.8em 0.8em;
description = CharField(_('description'), max_length=255, blank=True)
type = ForeignKey('CourseType', related_name='course', verbose_name=_('course type'))
code = CharField(_('code'), max_length=255)
+ date_modified = DateTimeField(_('date modified'), auto_now=True)
notes = generic.GenericRelation(Note)
class MediaBase(Model):
"Base media resource"
+ title = CharField(_('title'), max_length=255, blank=True)
+ description = CharField(_('description'), max_length=255, blank=True)
credits = CharField(_('credits'), max_length=255, blank=True)
is_published = BooleanField(_('published'))
date_added = DateTimeField(_('date added'), auto_now_add=True)
date_modified = DateTimeField(_('date modified'), auto_now=True)
+ code = CharField(_('code'), max_length=255, blank=True)
notes = generic.GenericRelation(Note)
class Meta:
abstract = True
- ordering = ['-date_added']
class Document(MediaBase):
element_type = 'document'
- title = CharField(_('title'), max_length=255, blank=True)
- description = CharField(_('description'), max_length=255, blank=True)
- code = CharField(_('code'), max_length=255, blank=True)
course = ForeignKey('Course', related_name='document', verbose_name='course')
conference = ForeignKey('Conference', related_name='document', verbose_name=_('conference'),
blank=True, null=True)
def get_read(self, user):
return user in self.readers
+ def save(self, **kwargs):
+ super(Document, self).save(**kwargs)
+ self.course.save()
+
class Meta:
db_table = app_label + '_' + 'document'
+ ordering = ['-date_modified']
class Media(MediaBase):
class Meta:
db_table = app_label + '_' + 'media'
+ ordering = ['-date_modified']
# STUDENT
{% if course.conference.all %}
<div class="course_content">
+<div class="course_subtitle">
<h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Conferences"%}</h3>
+</div>
<table class="listing" width="100%">
<thead>
<tr>
<th class="highlight">{% trans "Session" %}</th>
<th>{% trans "Professor" %}</th>
- <th>{% trans "Date added" %}</th>
+ <th>{% trans "Date begin" %}</th>
</tr>
</thead>
<tbody>
{% if course.document.all %}
<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>
<table class="listing" width="100%">
<thead>
<tr>
<th class="highlight">{% trans "Title" %}</th>
<th>{% trans "Description" %}</th>
- <th>{% trans "Date added" %}</th>
<th>{% trans "Annal" %}</th>
-<!-- <th>{% trans "Download" %}</th> -->
+ <th>{% trans "Date modified" %}</th>
+ <th>{% trans "Download" %}</th>
</tr>
</thead>
<tbody>
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
<td><a href="{% url teleforma-document-view document.id %}" target="_blank">{{ document.title }}</a></td>
<td>{{ document.description }}</td>
- <td>{{ document.date_added }}</td>
<td>{{ document.is_annal }}</td>
- <!--<td><a href="{% url teleforma-document-view document.id %}"><img src="{% url telemeta-images "download.png" %}" width="20px" /></a></td>-->
+ <td>{{ document.date_added }}</td>
+ <td><a href="{% url teleforma-document-view document.id %}"><img src="{% url telemeta-images "download.png" %}" width="20px" /></a></td>
</tr>
{% endfor %}
</tbody>
{% if course.media.all %}
<div class="course_content">
+<div class="course_subtitle">
<h3><img src="{% url telemeta-images "item_title.png" %}" style="vertical-align:middle" /> {% trans "Medias"%}</h3>
+</div>
<table class="listing" width="100%">
<thead>
<tr>
<th class="highlight">{% trans "Title" %}</th>
<th>{% trans "Description" %}</th>
- <th>{% trans "Date added" %}</th>
+ <th>{% trans "Date modified" %}</th>
</tr>
</thead>
<tbody>
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
<td><a href="{% url teleforma-media-detail media.id %}">{{ media.item.title }}</a></td>
<td>{{ media.item.description }}</td>
- <td>{{ media.date_added }}</td>
+ <td>{{ media.date_modified }}</td>
</tr>
{% endfor %}
</tbody>
courses = Course.objects.all()
else:
courses = None
+ courses = courses.order_by('-date_modified')
return courses
def stream_from_file(__file):