font-weight: bold;
}
-
-
-
+/* New resource indicator */
+.new-resource {
+ background-color: #e74c3c;
+ color: white;
+ padding: 2px 8px;
+ border-radius: 3px;
+ font-size: 0.85em;
+ font-weight: bold;
+}
\ No newline at end of file
var $tbody = $(this);
if($tbody.find('tr').size()>=2) {
$tbody.find('tr:not(:first)').remove();
- $tbody.append('<tr><td><a href="'+course_url+'">Voir la suite</a></td><td></td><td></td></tr>')
+ $tbody.append('<tr><td><a href="'+course_url+'">Voir la suite</a></td><td></td><td></td><td></td></tr>')
}
});
})
<tbody>
{% for doc in docs|from_course_type:type|from_doc_type:doc_type|from_periods:period|published %}
<tr>
- <td {% if forloop.first %}class="border-top"{% endif %} width="60%">{% if doc.file %}<a href="{% url 'teleforma-document-view' doc.id %}" target="_blank" title="{% trans "View" %}"><img src="/static//teleforma/images/application-msword.png" style="vertical-align:middle" alt="" />{% endif %} {{ doc.title }}{% if doc.file %}</a>{% endif %}</td>
- <td {% if forloop.first %}class="border-top"{% endif %} width="35%">{{ doc.date_added }}</td>
+ <td {% if forloop.first %}class="border-top"{% endif %} width="55%">{% if doc.file %}<a href="{% url 'teleforma-document-view' doc.id %}" target="_blank" title="{% trans "View" %}"><img src="/static//teleforma/images/application-msword.png" style="vertical-align:middle" alt="" />{% endif %} {{ doc.title }}{% if doc.file %}</a>{% endif %}</td>
+ <td {% if forloop.first %}class="border-top"{% endif %} width="30%">{{ doc.date_added }}</td>
<td {% if forloop.first %}class="border-top"{% endif %} width="5%" align="center">{% if doc.file %}<a href="{% url 'teleforma-document-download' doc.id %}"><img src="/static/teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a>{% endif %}</td>
+ <td {% if forloop.first %}class="border-top"{% endif %} width="10%" align="center">
+ {% if not doc|document_read:user %}
+ <span class="new-resource">Nouveau</span>
+ {% endif %}
+ </td>
</tr>
{% endfor %}
</tbody>
<img src="/static/teleforma/images/delete.png" style="vertical-align:middle" alt="" title="{% trans ' rejected' %}" />
{% endif %}
{% endif %}
+ {% if not conference.video|media_read:user %}
+ <span class="new-resource">Nouveau</span>
+ {% endif %}
{% if conference.video.file %}
{% if not "video" in conference.video.mime_type or request.user_agent.os.family == 'iOS' %}
<a href="{% url 'teleforma-media-download' period.id conference.video.id %}">
def conference_publication(context, conference):
period = context['period']
return conference.publication_info(period)
+
+@register.filter
+def document_read(document, user):
+ return document.readers.filter(id=user.id).exists()
+
+@register.filter
+def media_read(media, user):
+ return media.readers.filter(id=user.id).exists()
courses = get_courses(request.user)
document = Document.objects.get(pk=pk)
if get_access(document, courses):
+ # Track document read
+ document.readers.add(request.user)
return serve_media(document.file.path.encode('utf8'), streaming=True)
else:
return redirect('teleforma-home')
@access_required
def create_bbb_conference(request, period_id, course_id, course_type_id):
"""
- Create a BBB conference
+ Create a Conference object and join a bbb webclass with a random room id.
+ A cron script will later store the BBB record id in the Conference object.
"""
+
username = request.user.get_full_name()
is_professor = len(request.user.professor.all()) >= 1
is_staff = request.user.is_staff or request.user.is_superuser