stream_type = CharField(_('Streaming type'),
choices=streaming_choices, max_length=32)
+ @property
+ def slug(self):
+ slug = '-'.join([self.course.department.slug, self.course.slug,
+ self.course_type.name.lower()])
+ return slug
+
@property
def mount_point(self):
- slug = '-'.join([self.conference.course.department.slug, self.conference.course.slug,
- self.conference.course_type.name.lower()])
if self.server.type == 'stream-m':
- return 'consume/' + slug
+ return 'consume/' + self.slug
else:
- return slug + '.' + self.stream_type
+ return self.slug + '.' + self.stream_type
@property
def url(self):
return 'http://' + self.server.host + ':' + self.server.port + '/' + self.mount_point
def __unicode__(self):
- return self.conference.description
+ if self.conference:
+ return self.conference.description
+ else:
+ return self.slug
class Meta:
db_table = app_label + '_' + 'live_stream'
background-color: transparent;
}
table.listing tbody tr { border-top: 1px solid #ddd }
-table.listing tbody tr.even { background-color: #fcfcfc }
-table.listing tbody tr.odd { background-color: #f7f7f7 }
-table.listing tbody tr:hover { background: #f7f8fa !important }
+table.listing tbody tr.even { background-color: transparent }
+table.listing tbody tr.odd { background-color: transparent }
+table.listing tbody tr:hover { background: transparent !important }
table td.error {
color: red;
.course_subtitle {
padding: 0.3em;
-
}
.course_content p {
{% extends "postman/base.html" %}
{% load i18n %}
+{% load teleforma_tags %}
+
{% block extrahead %}{{ block.super }}
{% if is_autocompleted %}
{# using the available admin jQuery is enough #}
<link href="{{ MEDIA_URL }}css/jquery.autocomplete.css" type="text/css" media="all" rel="stylesheet" />
{% endif %}
{% endblock %}
+
{% block content %}
<div id="postman" class="desk_messages">
<h1>{% block pm_write_title %}{% endblock %}</h1>
+
+{% if user.student.all %}
<div style="padding-top: 0.5em;">
+
<select id="_professorSelect" name="professors" onchange="update_recipients();">
<option>{% trans "Choose a professor" %}</option>
-<option value="admin">me</option>
-<option value="a.abou-el-haja">You</option>
+{% get_professors as professors %}
+{% for p in professors %}
+<option value="{{ p.user.username }}">{{p.user.first_name}} {{p.user.last_name}}</option>
+{% endfor %}
</select>
+
+<select id="_adminSelect" name="admins" onchange="update_recipients();">
+<option>{% trans "Choose an administrator" %}</option>
+{% get_admins as admins %}
+{% for a in admins %}
+<option value="{{ a.username }}">{{a.first_name}} {{a.last_name}}</option>
+{% endfor %}
+</select>
+
</div>
+{% endif %}
+
<div class="write_content">
<form id="_messageForm" action="{% if next_url %}?next={{ next_url|urlencode }}{% endif %}" method="post">{% csrf_token %}
<table>
var htmlStr = $(this).val();
$("#id_recipients").val(htmlStr);
});
+$("#_adminSelect").click(function () {
+ var htmlStr = $(this).val();
+ $("#id_recipients").val(htmlStr);
+ });
+
}
+
$('#send_button').click(function() {
$('#_messageForm').submit();
});
<div class="course_media">
<div class="course_title">{{ document.course.title }}{% for type in document.course_type.all%} - {{ type }}{% endfor %}{% if document.type %} - {{ document.type }}{% endif %}<br />
-{% if document.title %}<h4>{{ document.title }}</h4>{% endif %}
</div>
{% if access_error %}
{% with c.course as course %}
{% for type in c.types %}
<div class="course">
- <div class="course_title">{{ course.title }} - {{ type }}{% if course.description %} - {{ course.description }}{% endif %}
+ <div class="course_title">
+ <a href="{% url teleforma-course-detail course.id %}" style="color: #000;">{{ course.title }} - {{ type }}{% if course.description %} - {{ course.description }}{% endif %}</a>
</div>
{% block conference %}
{% load teleforma_tags %}
{% load i18n %}
-{% if course.conference.all|from_course_type:type %}
+{% if course.livestream.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>
+ <h3><img src="{% url telemeta-images "item_title.png" %}" width="10px" alt="" /> {% trans "Live conference"%}</h3>
</div>
<table class="listing" width="100%">
- <thead>
- <tr>
- <th class="highlight">{% trans "Session" %}</th>
- <th>{% trans "Professor" %}</th>
- <th>{% trans "Begin date" %}</th>
- <th>{% trans "Streaming" %}</th>
- </tr>
- </thead>
<tbody>
- {% for conference in course.conference.all|from_course_type:type %}
+ {% for stream in course.livestream.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 teleforma-conference-detail conference.id %}" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/network-wireless_r.png" style="vertical-align:middle" alt="" /> {{ stream.slug }}</a></td>
<td>{% if conference.professor.user %}<a href="{% url teleforma-profile-detail conference.professor.user.username %}" target="_blank">{{ conference.professor }}</a>{% endif %}</td>
<td><a href="{% url teleforma-conference-detail conference.id %}">{{ conference.date_begin }}</a></td>
<td align="center">
{% 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>
+<h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Documents"%}</h3>
</div>
{% for doc_type in doc_types %}
{% 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>
- <th class="highlight">{% trans "Title" %}</th>
- <th>{% trans "Annal" %}</th>
- <th>{% trans "Date modified" %}</th>
- <th>{% trans "Download" %}</th>
- </tr>
- </thead>
<tbody>
{% 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-view document.id %}" target="_blank">{% endif %}{{ document.title }}{% if document.file %}</a>{% endif %}</td>
- <td align="center">
+ <tr>
+ <td>{% if document.file %}<a href="{% url teleforma-document-view document.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/icon_doc_16.png" style="vertical-align:middle" alt="" />{% endif %} {{ document.title }}{% if document.file %}</a>{% endif %}</td>
+ <!--<td align="center">
{% if document.is_annal %}
<img src="images/ok.png" alt="yes" style="vertical-align:middle" />
{% endif %}
- </td>
+ </td>-->
<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>
+ <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" alt="" title="{% trans "Download" %}" /></a>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
{% 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>
+ <h3><img src="{% url telemeta-images "item_title.png" %}" width="10px" alt="" /> {% trans "Passed conferences"%}</h3>
</div>
<table class="listing" width="100%">
- <thead>
- <tr>
- <th class="highlight">{% trans "Title" %}</th>
- <th>{% trans "Session" %}</th>
- <th>{% trans "Professor" %}</th>
- <th>{% trans "Begin date" %}</th>
- <th>{% trans "Duration" %}</th>
- </tr>
- </thead>
<tbody>
{% 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.title }}</a></td>
+ <tr>
+ <td><a href="{% url teleforma-media-detail media.id %}" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/tool-animator_r.png" style="vertical-align:middle" alt="" /> {{ media.title }}</a></td>
<td><a href="{% url teleforma-media-detail media.id %}">{{ media.conference.session }}</a></td>
<td>{% if media.conference.professor.user %}<a href="{% url teleforma-profile-detail media.conference.professor.user.username %}" target="_blank">{{ media.conference.professor }}</a>{% endif %}</td>
<td>{% if media.conference.date_begin %}<a href="{% url teleforma-media-detail media.id %}">{{ media.conference.date_begin }}</a>{% endif %}</td>
@register.filter
def from_doc_type(docs, type):
return docs.filter(type=type)
+
+@register.assignment_tag
+def get_professors():
+ return Professor.objects.all()
+
+@register.assignment_tag
+def get_admins():
+ return User.objects.filter(is_staff=True)
+
+@register.assignment_tag
+def get_trainings():
+ return Training.objects.all()
+
+@register.assignment_tag
+def get_eijs():
+ return IEJ.objects.all()
+
+@register.assignment_tag
+def get_courses():
+ return Course.objects.all()
+
+
'date': course.date_modified, 'number': course.number})
return courses
+
def get_courses(user, date_order=False, num_order=False):
+ courses = []
+
if not user.is_authenticated():
- return []
+ return courses
professor = user.professor.all()
student = user.student.all()
- courses = []
if professor:
professor = user.professor.get()