# Authors: Guillaume Pellerin <yomguy@parisson.com>
import os.path
-from django.conf.urls.defaults import *
-from django.views.generic import *
-from django.views.generic.base import *
+from django.conf.urls import patterns, url, include
+from django.http import HttpResponse
from teleforma.exam.models import *
from teleforma.exam.views import *
from jsonrpc import jsonrpc_site
<div style="background: white;">
{% postman_unread as unread_count %}
<ul>
-<li><a href="{% url postman_inbox %}">{% if unread_count %} <strong>{% trans "Inbox" %} ({{ unread_count }})</strong>{% else %}{% trans "Inbox" %}{% endif %}</a></li>
-<li><a href="{% url postman_sent %}">{% trans "Sent Messages" %}</a></li>
-<li><a href="{% url postman_archives %}">{% trans "Archives" %}</a></li>
-<li><a href="{% url postman_trash %}">{% trans "Trash" %}</a></li>
+<li><a href="{% url 'postman_inbox' %}">{% if unread_count %} <strong>{% trans "Inbox" %} ({{ unread_count }})</strong>{% else %}{% trans "Inbox" %}{% endif %}</a></li>
+<li><a href="{% url 'postman_sent' %}">{% trans "Sent Messages" %}</a></li>
+<li><a href="{% url 'postman_archives' %}">{% trans "Archives" %}</a></li>
+<li><a href="{% url 'postman_trash' %}">{% trans "Trash" %}</a></li>
</ul>
</div>
</div>
<div class="module_action">
-<a href="{% url postman_write %}" class="component_icon button" id="action_orange">{% trans "New message" %}</a>
+<a href="{% url 'postman_write' %}" class="component_icon button" id="action_orange">{% trans "New message" %}</a>
</div>
</div>
<tr>
<td><input type="checkbox" {% if by_conversation and message.thread_id %}name="tpks" value="{{ message.thread_id }}"{% else %}name="pks" value="{{ message.pk }}"{% endif %} /></td>
- {% block pm_sender_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url postman_view_conversation message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">{% if message.is_new %}<strong>{% endif %}{{ message.obfuscated_sender|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% if message.is_new %}</strong>{% endif %}</a></td>{% endblock %}
+ {% block pm_sender_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman_view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">{% if message.is_new %}<strong>{% endif %}{{ message.obfuscated_sender|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}{% if message.is_new %}</strong>{% endif %}</a></td>{% endblock %}
- {% block pm_recipient_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url postman_view_conversation message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">{{ message.obfuscated_recipient|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}</a></td>{% endblock %}
+ {% block pm_recipient_cell %}<td><a href="{% if by_conversation and message.thread_id %}{% url 'postman_view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">{{ message.obfuscated_recipient|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}</a></td>{% endblock %}
<td>{% if message.is_new %}<strong>{% endif %}{% if message.is_replied %}<em>{% endif %}
{% block pm_subject %}
- <a href="{% if by_conversation and message.thread_id %}{% url postman_view_conversation message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">
+ <a href="{% if by_conversation and message.thread_id %}{% url 'postman_view_conversation' message.thread_id %}{% else %}{{message.get_absolute_url }}{% endif %}?next={{ current_url|urlencode }}">
{% include "postman/inc_subject_ex.html" %}
</a>{% endblock %}
{% if message.is_replied %}</em>{% endif %}{% if message.is_new %}</strong>{% endif %}</td>
<br />
{% block pm_form_buttons %}<span id="pm_buttons">
{% block pm_delete_button %}
-<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url postman_delete %}'; f.submit(); return false;">{% trans "Delete" %}</a>
+<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
{% endblock %}
{% block pm_archive_button %}
-<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url postman_archive %}'; f.submit(); return false;">{% trans "Archive" %}</a>
+<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
{% endblock %}
{% block pm_undelete_button %}
-<a href="#" class="component_icon button icon_previous" onclick="f=document.getElementById('_messageForm'); f.action='{% url postman_undelete %}'; f.submit(); return false;">{% trans "Undelete" %}</a>
+<a href="#" class="component_icon button icon_previous" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_undelete' %}'; f.submit(); return false;">{% trans "Undelete" %}</a>
{% endblock %}
</span>{% endblock %}
{% for message in pm_messages %}
<div class="pm_message{% if message.is_pending %} pm_pending{% endif %}{% if message.is_rejected %} pm_rejected{% endif %}{% if message.sender == user and message.sender_archived or message.recipient == user and message.recipient_archived %} pm_archived{% endif %}{% if message.sender == user and message.sender_deleted_at or message.recipient == user and message.recipient_deleted_at %} pm_deleted{% endif %}{% if message.recipient == user and not message.read_at %} pm_unread{% endif %}">
<div class="pm_header">
- <a href="{% url telemeta-profile-detail message.obfuscated_sender %}">
+ <a href="{% url 'telemeta-profile-detail' message.obfuscated_sender %}">
<span class="pm_sender">{{ message.obfuscated_sender|or_me:user }}</span>
</a>»
- <a href="{% url telemeta-profile-detail message.obfuscated_recipient %}">
+ <a href="{% url 'telemeta-profile-detail' message.obfuscated_recipient %}">
<span class="pm_recipient">{{ message.obfuscated_recipient|or_me:user }}</span>
</a> |
<span class="pm_date">{{ message.sent_at|date:"DATETIME_FORMAT"}}</span> |
<a href="{{ next_url }}" class="component_icon button icon_previous">{% trans "Back" %}</a>
<span id="pm_buttons">
{% block pm_delete_button %}
-<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url postman_delete %}'; f.submit(); return false;">{% trans "Delete" %}</a>
+<a href="#" class="component_icon button icon_delete" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_delete' %}'; f.submit(); return false;">{% trans "Delete" %}</a>
{% endblock %}
{% block pm_archive_button %}
{% if not archived %}
-<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url postman_archive %}'; f.submit(); return false;">{% trans "Archive" %}</a>
+<a href="#" class="component_icon button icon_save" onclick="f=document.getElementById('_messageForm'); f.action='{% url 'postman_archive' %}'; f.submit(); return false;">{% trans "Archive" %}</a>
{% endif %}
{% endblock %}
-{% if reply_to_pk %}<a class="component_icon button icon_next" href="{% url postman_reply reply_to_pk %}?next={{ next_url|urlencode }}">{% trans "Reply" %}</a>{% endif %}
+{% if reply_to_pk %}<a class="component_icon button icon_next" href="{% url 'postman_reply' reply_to_pk %}?next={{ next_url|urlencode }}">{% trans "Reply" %}</a>{% endif %}
</form>
{% if reply_to_pk %}<hr />
<h2>{% trans 'Reply' %}</h2>
-<form id="_messageReply" action="{% url postman_reply reply_to_pk %}?next={{ next_url|urlencode }}" method="post">{% csrf_token %}
+<form id="_messageReply" action="{% url 'postman_reply' reply_to_pk %}?next={{ next_url|urlencode }}" method="post">{% csrf_token %}
<div id="pm_reply">{{ form.body }}</div><br />
<a href="#" class="component_icon button icon_next" onclick="f=document.getElementById('_messageReply'); f.submit(); return false;">{% trans "Reply" %}</a>
<div id="module-set-left" style="width: 20%">
<div class="module">
-<h3><a href="{% url teleforma-home %}"><img src="{{ STATIC_URL }}telemeta/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "My courses" %}</a></h3>
+<h3><a href="{% url 'teleforma-home' %}"><img src="{{ STATIC_URL }}telemeta/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "My courses" %}</a></h3>
<div style="background: white;">
<ul>
{% block courses %}
{% for c in all_courses %}
{% with c.course as course %}
- <li><a href="{% url teleforma-annals-course course.id %}">{{ course.title }}</a></li>
+ <li><a href="{% url 'teleforma-annals-course' course.id %}">{{ course.title }}</a></li>
{% endwith %}
{% endfor %}
{% endblock courses %}
<ul>
{% block iej %}
{% for iej in iejs %}
- <li><a href="{% url teleforma-annals-iej iej.id %}">{{ iej.name|lower|capfirst }}</a></li>
+ <li><a href="{% url 'teleforma-annals-iej' iej.id %}">{{ iej.name|lower|capfirst }}</a></li>
{% endfor %}
{% endblock iej %}
</ul>
<tbody>
{% for doc in docs %}
<tr>
- <td {% if forloop.first %}class="border-top"{% endif %} width="50%">{% if doc.file %}<a href="{% url teleforma-document-view doc.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/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="50%">{% if doc.file %}<a href="{% url 'teleforma-document-view' doc.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/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="40%">{{ year }}</td>
- <td {% if forloop.first %}class="border-top"{% endif %} width="10%" align="center">{% if doc.file %}<a href="{% url teleforma-document-download doc.id %}"><img src="{{ STATIC_URL }}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 doc.file %}<a href="{% url 'teleforma-document-download' doc.id %}"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</tr>
{% for media in course.media.all %}
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
-<td><a href="{% url telemeta-item-detail media.item.public_id %}">{{ media.item.title }}</a></td>
+<td><a href="{% url 'telemeta-item-detail' media.item.public_id %}">{{ media.item.title }}</a></td>
<td>{{ media.item.description }}</td>
<td>{{ media.date_added }}</td>
</tr>
var conferenceUtils = {
stop : function(id){
json([id],'teleforma.stop_conference',function(){
- location.href = '{% url teleforma-conference-record %}';
+ location.href = '{% url 'teleforma-conference-record' %}';
}
);
}}
<div class="course_title">
<div style="float: right; font-size: 0.9em;">
- <a href="{% url teleforma-conference-audio period.id conference.id %}" class="component_icon button icon_speaker"> {% trans "Audio" %}</a>
+ <a href="{% url 'teleforma-conference-audio' period.id conference.id %}" class="component_icon button icon_speaker"> {% trans "Audio" %}</a>
</div>
-<a href="{% url teleforma-desk-period-course period.id course.id %}" style="color: #000;">{{ course.title }}</a> - {{ type }} - {% trans "Session" %} {{ conference.session }}
+<a href="{% url 'teleforma-desk-period-course' period.id course.id %}" style="color: #000;">{{ course.title }}</a> - {{ type }} - {% trans "Session" %} {{ conference.session }}
</div>
<dl class="listing">
{% if conference.professor %}
-<dt>{% trans "Course" %}</dt><dd><a href="{% url teleforma-desk-period-course period.id course.id %}">{{ conference.course.title }} - {{ conference.course_type }}</a></dd>
+<dt>{% trans "Course" %}</dt><dd><a href="{% url 'teleforma-desk-period-course' period.id course.id %}">{{ conference.course.title }} - {{ conference.course_type }}</a></dd>
<dt>{% trans "Session" %}</dt><dd>{{ conference.session }}</dd>
<dt>{% trans "Professor" %}</dt>
- <dd><a href="{% url telemeta-profile-detail conference.professor.user.username %}" target="_blank">{{ conference.professor }}</a></dd>
+ <dd><a href="{% url 'telemeta-profile-detail' conference.professor.user.username %}" target="_blank">{{ conference.professor }}</a></dd>
{% endif %}
{% if conference.comment %}<dt>{% trans "Comment" %}</dt><dd>{{ conference.comment }}</dd>{% endif %}
<dt>{% trans "Begin date" %}</dt><dd>{{ conference.date_begin }}</dd>
var conferenceUtils = {
stop : function(id){
json([id],'teleforma.conference_stop',function(){
- location.href = '{% url teleforma-conference-record %}';});
+ location.href = '{% url 'teleforma-conference-record' %}';});
}}
jQuery(window).ready(function(){
<div class="course_title">
<div style="float: right; font-size: 0.9em;">
- <a href="{% url teleforma-conference-detail period.id conference.id %}" class="component_icon button icon_clap"> {% trans "Video" %}</a>
+ <a href="{% url 'teleforma-conference-detail' period.id conference.id %}" class="component_icon button icon_clap"> {% trans "Video" %}</a>
</div>
{{ course.title }}{% if course.description %} - {{ course.description }}{% endif %} - {{ conference.session }} - {{ conference.professor }}
<div class="course_content" id="media_infos">
<dl class="listing">
<dt>{% trans "Title" %}</dt><dd>{{ conference.course.title }}</dd>
-<dt>{% trans "Professor" %}</dt><dd><a href="{% url telemeta-profile-detail conference.professor.user.username %}" target="_blank">{{ conference.professor }}</a></dd>
+<dt>{% trans "Professor" %}</dt><dd><a href="{% url 'telemeta-profile-detail' conference.professor.user.username %}" target="_blank">{{ conference.professor }}</a></dd>
<dt>{% trans "Session" %}</dt><dd>{{ conference.session }}</dd>
<dt>{% trans "Room" %}</dt><dd>{{ conference.room }}</dd>
<dt>{% trans "Begin" %}</dt><dd>{{ conference.date_begin }}</dd>
<script type="text/javascript">
$(document).ready(function(){
- InitChatWindow("{% url jqchat_ajax room.id %}", null);
+ InitChatWindow("{% url 'jqchat_ajax' room.id %}", null);
});
</script>
{% block extra_javascript %}
<script type="text/javascript">
$(document).ready(function(){
- InitChatWindow("{% url jqchat_ajax room.id %}", null);
+ InitChatWindow("{% url 'jqchat_ajax' room.id %}", null);
});
</script>
{% endblock extra_javascript %}
{% block courses %}
{% for c in all_courses %}
{% with c.course as course %}
- <li><a href="{% url teleforma-desk-period-course period.id course.id %}">{{ course.title }}</a></li>
+ <li><a href="{% url 'teleforma-desk-period-course' period.id course.id %}">{{ course.title }}</a></li>
{% endwith %}
{% endfor %}
{% endblock courses %}
<script type="text/javascript">
$(document).ready(function(){
- InitChatWindow("{% url jqchat_ajax room.id %}", null);
+ InitChatWindow("{% url 'jqchat_ajax' room.id %}", null);
});
</script>
//
// Fetch the PDF document from the URL using promices
//
-PDFJS.getDocument('{% url teleforma-document-download document.id %}').then(function(pdf) {
+PDFJS.getDocument('{% url 'teleforma-document-download' document.id %}').then(function(pdf) {
// Using promise to fetch the page
pdf.getPage(1).then(function(page) {
var scale = 1.5;
<script type="text/javascript">
$(document).ready(function(){
- InitChatWindow("{% url jqchat_ajax room.id %}", null);
+ InitChatWindow("{% url 'jqchat_ajax' room.id %}", null);
$('#my_video_1').bind('contextmenu',function() { return false; });
});
</script>
<div class="course_title">
<div style="float: right; font-size: 0.9em;">
{% if "video" in media.mime_type %}
- <a href="{% url teleforma-media-detail period.id media|get_audio_id %}" class="component_icon button icon_speaker"> {% trans "Audio" %}</a>
+ <a href="{% url 'teleforma-media-detail' period.id media|get_audio_id %}" class="component_icon button icon_speaker"> {% trans "Audio" %}</a>
{% endif %}
{% if "audio" in media.mime_type %}
- <a href="{% url teleforma-media-detail period.id media|get_video_id %}" class="component_icon button icon_clap"> {% trans "Video" %}</a>
+ <a href="{% url 'teleforma-media-detail' period.id media|get_video_id %}" class="component_icon button icon_clap"> {% trans "Video" %}</a>
{% endif %}
{% if user.is_staff %}
<a id="publish" href="#" class="{% if media.is_published %}component_icon button icon_ok{% else %}component_icon button icon_delete{% endif %}">{% if media.is_published %}{% trans " published" %}{% else %}{% trans " rejected" %}{% endif %}</a>
{% endif %}
</div>
- <a href="{% url teleforma-desk-period-course period.id course.id %}">{{ course.title }} - {{ type }}{% if media.conference.session %} - {% trans "Session" %} {{ media.conference.session }}{% endif %}</a>
+ <a href="{% url 'teleforma-desk-period-course' period.id course.id %}">{{ course.title }} - {{ type }}{% if media.conference.session %} - {% trans "Session" %} {{ media.conference.session }}{% endif %}</a>
</div>
<dl class="listing">
{% if media.conference %}
-<dt>{% trans "Course" %}</dt><dd><a href="{% url teleforma-desk-period-course period.id course.id %}">{{ media.course.title }} - {{ media.course_type }}</a></dd>
+<dt>{% trans "Course" %}</dt><dd><a href="{% url 'teleforma-desk-period-course' period.id course.id %}">{{ media.course.title }} - {{ media.course_type }}</a></dd>
<dt>{% trans "Session" %}</dt><dd>{{ media.conference.session }}</dd>
{% if media.conference.professor %}
<dt>{% trans "Professor" %}</dt>
- <dd><a href="{% url telemeta-profile-detail media.conference.professor.user.username %}" target="_blank">{{ media.conference.professor }}</a></dd>
+ <dd><a href="{% url 'telemeta-profile-detail' media.conference.professor.user.username %}" target="_blank">{{ media.conference.professor }}</a></dd>
{% endif %}
{% if media.conference.comment %}<dt>{% trans "Comment" %}</dt><dd>{{ media.conference.comment }}</dd>{% endif %}
<dt>{% trans "Begin date" %}</dt><dd>{{ media.conference.date_begin }}</dd>
<dl class="listing">
{% if media.conference %}
-<dt>{% trans "Course" %}</dt><dd><a href="{% url teleforma-desk-period-course period.id course.id %}">{{ media.course.title }} - {{ media.course_type }}</a></dd>
+<dt>{% trans "Course" %}</dt><dd><a href="{% url 'teleforma-desk-period-course' period.id course.id %}">{{ media.course.title }} - {{ media.course_type }}</a></dd>
<dt>{% trans "Session" %}</dt><dd>{{ media.conference.session }}</dd>
{% if media.conference.professor %}
<dt>{% trans "Professor" %}</dt>
- <dd><a href="{% url telemeta-profile-detail media.conference.professor.user.username %}" target="_blank">{{ media.conference.professor }}</a></dd>
+ <dd><a href="{% url 'telemeta-profile-detail' media.conference.professor.user.username %}" target="_blank">{{ media.conference.professor }}</a></dd>
{% endif %}
{% if media.conference.comment %}<dt>{% trans "Comment" %}</dt><dd>{{ media.conference.comment }}</dd>{% endif %}
<dt>{% trans "Begin date" %}</dt><dd>{{ media.conference.date_begin }}</dd>
{% block extra_javascript %}
<script type="text/javascript">
$(document).ready(function(){
- InitChatWindow("{% url jqchat_ajax room.id %}", null);
+ InitChatWindow("{% url 'jqchat_ajax' room.id %}", null);
});
</script>
{% endblock extra_javascript %}
{% block courses %}
{% for c in all_courses %}
{% with c.course as course %}
- <li><a href="{% url teleforma-desk-period-course period.id course.id %}">{{ course.title }}</a></li>
+ <li><a href="{% url 'teleforma-desk-period-course' period.id course.id %}">{{ course.title }}</a></li>
{% endwith %}
{% endfor %}
{% endblock courses %}
{% get_telecaster as telecaster %}
{% if telecaster %}
<div class="module_action">
-<a href="{% url teleforma-conference-record %}" class="component_icon button" id="action_red">{% trans "New conference" %}</a>
+<a href="{% url 'teleforma-conference-record' %}" class="component_icon button" id="action_red">{% trans "New conference" %}</a>
</div>
{% endif %}
{% endblock module-action %}
{% for type in c.types %}
<div class="course">
<div class="course_title">
- <a href="{% url teleforma-desk-period-course period.id course.id %}">{{ course.title }} - {{ type }}{% if course.description %} - {{ course.description }}{% endif %}</a>
+ <a href="{% url 'teleforma-desk-period-course' period.id course.id %}">{{ course.title }} - {{ type }}{% if course.description %} - {{ course.description }}{% endif %}</a>
</div>
{% block conference %}
<tr>
{% if stream.streaming %}
<td {% if forloop.first %}class="border-top"{% endif %} width="230px">
- <a href="{% url teleforma-conference-detail period.id stream.conference.id %}" title="{% trans "View" %}">
+ <a href="{% url 'teleforma-conference-detail' period.id stream.conference.id %}" title="{% trans "View" %}">
<img id="snapshot-{{ stream.course.code }}-{{ stream.course_type }}" src="{{ stream.snapshot_url }}" width="100%" alt="{% trans 'Click here' %}" />
</a>
</td>
<dt>{% trans "Title" %}</dt><dd>{{ stream.conference.course.title }}</dd>
<dt>{% trans "Session" %}</dt><dd>{{ stream.conference.session }}</dd>
{% if stream.conference.professor.user.username %}
- <dt>{% trans "Professor" %}</dt><dd><a href="{% url telemeta-profile-detail stream.conference.professor.user.username %}" target="_blank">{{ stream.conference.professor }}</a></dd>
+ <dt>{% trans "Professor" %}</dt><dd><a href="{% url 'telemeta-profile-detail' stream.conference.professor.user.username %}" target="_blank">{{ stream.conference.professor }}</a></dd>
{% endif %}
<dt>{% trans "Begin" %}</dt><dd>{{ stream.conference.date_begin }}</dd>
</dl>
{% if doc.course_type.all|length > 1 and type_counter > 1 %}
{% else %}
<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_URL }}/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="60%">{% if doc.file %}<a href="{% url 'teleforma-document-view' doc.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/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="5%" align="center">{% if doc.file %}<a href="{% url teleforma-document-download doc.id %}"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a>{% endif %}</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_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a>{% endif %}</td>
</tr>
{% endif %}
{% endfor %}
{% if media.type == 'webm' %}
<tr>
<td {% if forloop.first %}class="border-top"{% endif %} width="230px" style="vertical-align:middle">
- <a href="{% url teleforma-media-detail period.id media.id %}" title="{% trans "Play" %}">
+ <a href="{% url 'teleforma-media-detail' period.id media.id %}" title="{% trans "Play" %}">
{% if media.item.related.all %}
{% for related in media.item.related.all %}
{% if related.title == "preview" %}
<dt>{% trans "Title" %}</dt><dd>{{ media.conference.course.title }}</dd>
<dt>{% trans "Session" %}</dt><dd>{{ media.conference.session }}</dd>
{% if media.conference.professor %}
- <dt>{% trans "Professor" %}</dt><dd><a href="{% url telemeta-profile-detail media.conference.professor.user.username %}" target="_blank">{{ media.conference.professor }}</a></dd>
+ <dt>{% trans "Professor" %}</dt><dd><a href="{% url 'telemeta-profile-detail' media.conference.professor.user.username %}" target="_blank">{{ media.conference.professor }}</a></dd>
{% endif %}
<dt>{% trans "Begin" %}</dt><dd>{{ media.conference.date_begin }}</dd>
{% if media.conference.comment %}
{% block extra_stylesheets %}{% endblock %}
{% block javascript %}
-<script src="{% url django.views.i18n.javascript_catalog %}" type="text/javascript"></script>
+<script src="{% url 'django.views.i18n.javascript_catalog' %}" type="text/javascript"></script>
<script src="{{ STATIC_URL }}teleforma/js/jquery-1.6.min.js" type="text/javascript"></script>
<script src="{{ STATIC_URL }}teleforma/js/jquery-ui.js" type="text/javascript"></script>
<script src="{{ STATIC_URL }}teleforma/js/jquery.expander.min.js" type="text/javascript"></script>
<li><a href="#desk#" class="red"> {% trans "Desk" %} </a>
<ul>
{% for period in periods %}
- <li><a href="{% url teleforma-desk-period-list period.id %}" class="red">{{ period.name }}</a></li>
+ <li><a href="{% url 'teleforma-desk-period-list' period.id %}" class="red">{{ period.name }}</a></li>
{% endfor %}
</ul>
</li>
{% else %}
{% with periods.0 as period %}
- <li><a href="{% url teleforma-desk-period-list period.id %}" class="red">{% trans "Desk" %}</a></li>
+ <li><a href="{% url 'teleforma-desk-period-list' period.id %}" class="red">{% trans "Desk" %}</a></li>
{% endwith %}
{% endif %}
{% if user.is_authenticated %}
- <li><a href="{% url postman_inbox %}" class="orange">{% trans "Messaging" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
+ <li><a href="{% url 'postman_inbox' %}" class="orange">{% trans "Messaging" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
- <li><a href="{% url teleforma-annals %}" class="yellow">{% trans "Annals" %}</a></li>
+ <li><a href="{% url 'teleforma-annals' %}" class="yellow">{% trans "Annals" %}</a></li>
{% if exam_access %}
{% if periods|length == 1 %}
- <li><a href="{% url teleforma-exam-scripts-pending periods.0.id %}" class="green"> {% trans "Scripts" %}
+ <li><a href="{% url 'teleforma-exam-scripts-pending' periods.0.id %}" class="green"> {% trans "Scripts" %}
{% if user.is_staff or user.quotas.all %}{% untreated_scripts_count user periods.0.id %}
{% else %}{% treated_scripts_count user periods.0.id %}{% endif %}</a>
</li>
{% else %}{% treated_scripts_count user periods.0.id %}{% endif %}</a>
<ul>
{% for period in periods %}
- <li><a href="{% url teleforma-exam-scripts-pending period.id %}" class="green">{{ period.name }}</a></li>
+ <li><a href="{% url 'teleforma-exam-scripts-pending' period.id %}" class="green">{{ period.name }}</a></li>
{% endfor %}
</ul>
</li>
{% if user.is_authenticated %}
{% if user.is_staff %}
- <li><a href="{% url telemeta-admin-general %}" class="blue">{% trans "Admin" %}</a></li>
+ <li><a href="{% url 'telemeta-admin-general' %}" class="blue">{% trans "Admin" %}</a></li>
{% else %}
- <li><a href="{% url teleforma-help %}" class="blue">{% trans "Help" %}</a></li>
+ <li><a href="{% url 'teleforma-help' %}" class="blue">{% trans "Help" %}</a></li>
{% endif %}
<li style="a.active{background-image:{{ STATIC_URL }}telemeta/images/user_tr_bk.png; background-repeat: no-repeat;
{{ user.username }}
{% endif %}</a>
<ul>
- <li><a href="{% url telemeta-profile-detail user.username %}" class="yellow">{% trans "Profile" %}</a></li>
+ <li><a href="{% url 'telemeta-profile-detail' user.username %}" class="yellow">{% trans "Profile" %}</a></li>
{% if user.is_staff %}
- <li><a href="{% url telemeta-desk-lists %}">{% trans "Lists" %}</a></li>
- <li><a href="{% url teleforma-help %}">{% trans "Help" %}</a></li>
+ <li><a href="{% url 'telemeta-desk-lists' %}">{% trans "Lists" %}</a></li>
+ <li><a href="{% url 'teleforma-help' %}">{% trans "Help" %}</a></li>
{% endif %}
- <li><a href="{% url telemeta-logout %}">{% trans "Sign out" %}</a></li>
+ <li><a href="{% url 'telemeta-logout' %}">{% trans "Sign out" %}</a></li>
</ul>
</li>
<td>
<p class="right">
Copyright © {% current_year %} {% organization %} |
- <a href="{% url telemeta-flatpage "legal_notices" %}">{% trans "Legal notices" %}</a>
+ <a href="{% url 'telemeta-flatpage' "legal_notices" %}">{% trans "Legal notices" %}</a>
</p>
</td>
</tr>
{{ page_content|render_flatpage }}
</div>
-<a href="{% url telemeta-login %}" class="component_icon button" id="action_red">{% trans "Connexion" %}</a>
+<a href="{% url 'telemeta-login' %}" class="component_icon button" id="action_red">{% trans "Connexion" %}</a>
</div>
{% endblock %}
<div class="module">
{% block rss_title %}
- <a href="{% url telemeta-rss %}">
+ <a href="{% url 'telemeta-rss' %}">
<img src="{{ STATIC_URL }}telemeta/images/rss.png" alt="rss" style="vertical-align:middle" />
<h3>{% trans title %}</h3></a>
- <a href="{% url telemeta-rss %}" style="float:right" class="icon_rss"> </a>
+ <a href="{% url 'telemeta-rss' %}" style="float:right" class="icon_rss"> </a>
{% endblock rss_title %}
<div class="vscroll">
<td>
{% if r.element %}
{% if r.revision.element_type == "corpus" or r.revision.element_type == "fonds"%}
- <a href="{% url telemeta-resource-detail r.revision.element_type r.element.public_id %}">{{ r.element.title }}</a>
+ <a href="{% url 'telemeta-resource-detail' r.revision.element_type r.element.public_id %}">{{ r.element.title }}</a>
{% endif %}
{% if r.revision.element_type == "collection" %}
- <a href="{% url telemeta-collection-detail r.element.public_id %}">{{ r.element.title }}</a>
+ <a href="{% url 'telemeta-collection-detail' r.element.public_id %}">{{ r.element.title }}</a>
{% endif %}
{% if r.revision.element_type == "item" %}
- <a href="{% url telemeta-item-detail r.element.public_id %}">
+ <a href="{% url 'telemeta-item-detail' r.element.public_id %}">
{% if r.element.title != '' %}{{ r.element.title }}{% else %}{{ r.element.collection.title }} - {{ r.element.track }}{% endif %}</a>
{% endif %}
{% if r.revision.element_type == "marker" %}
- <a href="{% url telemeta-item-detail-marker r.element.public_id %}">{{ r.element.title }}</a>
+ <a href="{% url 'telemeta-item-detail-marker' r.element.public_id %}">{{ r.element.title }}</a>
{% endif %}
{% else %}
{% trans "deleted" %}
{% endif %}
</td>
<td>{{ r.revision.element_type }}</td>
- <td>{% if r.revision.user %}<a href="{% url telemeta-profile-detail r.revision.user.username %}">{{ r.revision.user.username }}</a>{% endif %}</td>
+ <td>{% if r.revision.user %}<a href="{% url 'telemeta-profile-detail' r.revision.user.username %}">{{ r.revision.user.username }}</a>{% endif %}</td>
</tr>
{% endfor %}
</table>
</tr>
{% for s in searches %}
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
- <td><a href="{% url telemeta-search-items %}?{{s.criteria.all|build_pattern_string|build_query_string}}">
+ <td><a href="{% url 'telemeta-search-items' %}?{{s.criteria.all|build_pattern_string|build_query_string}}">
{% for c in s.criteria.all %}
<li>{% trans c.key %} : {{ c.value}}</li>
{% endfor %}
{% load i18n %}
{% block rss_title %}
-<a href="{% url telemeta-user-rss user.username %}">
+<a href="{% url 'telemeta-user-rss' user.username %}">
<img src="{{ STATIC_URL }}telemeta/images/rss.png" alt="rss" style="vertical-align:middle" />
<h3>{% trans title %}</h3></a>
-<a href="{% url telemeta-user-rss user.username %}" style="float:right" class="icon_rss"> </a>
+<a href="{% url 'telemeta-user-rss' user.username %}" style="float:right" class="icon_rss"> </a>
{% endblock rss_title %}
<tbody id="spacing">
{% for user in page.object_list %}
<tr>
- <td><a href="{% url teleforma-profile-detail user.username %}">{{ user.last_name }}</a></td>
- <td><a href="{% url teleforma-profile-detail user.username %}">{{ user.first_name }}</a></td>
+ <td><a href="{% url 'teleforma-profile-detail' user.username %}">{{ user.last_name }}</a></td>
+ <td><a href="{% url 'teleforma-profile-detail' user.username %}">{{ user.first_name }}</a></td>
{% if user.student.get %}
{% with user.student.get as student %}
<td></td>
<td></td>
{% endif %}
- <td><a href="{% url postman_write user.username %}" class="component_icon button" id="action_orange">{% trans "Message" %}</a></td>
+ <td><a href="{% url 'postman_write' user.username %}" class="component_icon button" id="action_orange">{% trans "Message" %}</a></td>
</tr>
{% endfor %}
</tbody>
<td style="border-bottom:1px solid #6A0307;color:#6A0307;font-size: 100%">{{ playlist.playlist.title }}</td>
<td style="width:86ex; padding-right: 0; border-bottom:1px solid #6A0307; text-align:right">
<a href="#" id="{{playlist.playlist.public_id}}" onclick="playlistUtils.showEdit(this, this.id); return false;" class="component_icon button icon_edit">{% trans "Edit" %}</a>
- <a href="{% url telemeta-playlist-csv-export playlist.playlist.public_id 'collections' %}" class="component_icon button icon_csv">CSV Collections</a>
- <a href="{% url telemeta-playlist-csv-export playlist.playlist.public_id 'items' %}" class="component_icon button icon_csv">CSV Items</a>
+ <a href="{% url 'telemeta-playlist-csv-export' playlist.playlist.public_id 'collections' %}" class="component_icon button icon_csv">CSV Collections</a>
+ <a href="{% url 'telemeta-playlist-csv-export' playlist.playlist.public_id 'items' %}" class="component_icon button icon_csv">CSV Items</a>
<a href="#" id="{{playlist.playlist.public_id}}" onclick="if(confirm(gettrans('delete the playlist permanently?'))){playlistUtils.remove(this.id);};return false;" class="component_icon button icon_cancel">{% trans "Delete" %}</a>
</td>
</tr>
<tr {% if not forloop.counter0|divisibleby:"2" %}class="odd"{% endif %}>
<td>
{% if resource.type == "item" and not resource.element == None %}
- <a href="{% url telemeta-item-detail resource.element.public_id %}">{{ resource.element }}</a>
+ <a href="{% url 'telemeta-item-detail' resource.element.public_id %}">{{ resource.element }}</a>
{% endif %}
{% if resource.type == "collection" and not resource.element == None %}
- <a href="{% url telemeta-collection-detail resource.element.public_id %}">{% if resource.element.title %}{{ resource.element.title }}{% else %}{{ resource.element }}{% endif %}</a>
+ <a href="{% url 'telemeta-collection-detail' resource.element.public_id %}">{% if resource.element.title %}{{ resource.element.title }}{% else %}{{ resource.element }}{% endif %}</a>
{% endif %}
{% if resource.type == "marker" and not resource.element == None %}
- <a href="{% url telemeta-item-detail-marker resource.element.public_id %}">{{ resource.element }}</a>
+ <a href="{% url 'telemeta-item-detail-marker' resource.element.public_id %}">{{ resource.element }}</a>
{% endif %}
{% if resource.type == "corpus" or resource.type == "fonds" %}
- <a href="{% url telemeta-resource-detail resource.type resource.element.public_id %}">{{ resource.element.title }}</a>
+ <a href="{% url 'telemeta-resource-detail' resource.type resource.element.public_id %}">{{ resource.element.title }}</a>
{% endif %}
{% if resource.element == None %}{% trans "deleted" %}{% endif %}
</td>
{% if form.errors %}
<p class="login-error">{% trans "Your username and password didn't match. Please try again." %}</p>
{% endif %}
-<form class="login" id="_loginForm" method="post" action="{% url telemeta-login %}">{% csrf_token %}
+<form class="login" id="_loginForm" method="post" action="{% url 'telemeta-login' %}">{% csrf_token %}
<p>
{{ form.username.label_tag }}
{{ form.username }}<br />
{{ form.password }}
</p>
<div style="margin-top: 2em;">
-<span style="align: right; font-weight: bold; margin-right: 2em;"><a href="{% url telemeta-password-reset %}">{% trans "Password forgotten" %} ?</a></span>
+<span style="align: right; font-weight: bold; margin-right: 2em;"><a href="{% url 'password_reset' %}">{% trans "Password forgotten" %} ?</a></span>
<a href="#" class="component_icon button" id="action_red" onclick="$('#_loginForm').submit();"><img src="{{STATIC_URL}}telemeta/images/password.png" alt="" style="vertical-align:middle" /> {% trans "Sign in" %}</a>
<input type="hidden" name="next" value="{{ next }}" />
</div>
{% block modules %}
<div class="module">
- <h3><a href="{% url teleforma-home %}"><img src="{{ STATIC_URL }}telemeta/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% if user.username != usr.username%}{% trans "His courses" %}{% else %}{% trans "My courses" %}{% endif %}</a></h3>
+ <h3><a href="{% url 'teleforma-home' %}"><img src="{{ STATIC_URL }}telemeta/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% if user.username != usr.username%}{% trans "His courses" %}{% else %}{% trans "My courses" %}{% endif %}</a></h3>
<div style="background: white;">
<ul>
{% block courses %}
{% if user.is_authenticated and user.username != usr.username %}
<div class="module_action">
- <a href="{% url postman_write usr.username %}" class="component_icon button" id="action_orange">{% trans "Send a message" %}</a>
+ <a href="{% url 'postman_write' usr.username %}" class="component_icon button" id="action_orange">{% trans "Send a message" %}</a>
</div>
{% endif %}
</div>
<div id="password" style="float: right;">
{% if user.is_authenticated and user.username == usr.username %}
- <a href="{% url telemeta-password-change %}" class="component_icon button icon_login">{% trans "Change password" %}</a>
+ <a href="{% url 'telemeta-password-change' %}" class="component_icon button icon_login">{% trans "Change password" %}</a>
{% elif user.is_staff %}
- <a href="{% url teleforma-user-login usr.id %}" class="component_icon button icon_login">{% trans "Login as" %}</a>
+ <a href="{% url 'teleforma-user-login' usr.id %}" class="component_icon button icon_login">{% trans "Login as" %}</a>
{% endif %}
</div>
</div>
<div class="buttons">
-<!--<a href="{% url telemeta-password-change %}" class="component_icon button icon_login">{% trans "Password reset" %}</a>-->
+<!--<a href="{% url 'telemeta-password-change' %}" class="component_icon button icon_login">{% trans "Password reset" %}</a>-->
</div>
</div>
}
$(document).ready(function () {
- $('#location').autocomplete('{% url telemeta-complete-location %}', {
+ $('#location').autocomplete('{% url 'telemeta-complete-location' %}', {
max: 20,
formatResult: function(data) {
return data[0].replace(/ *\([0-9]+.*\) *$/, '');
<div class="course">
<h1>{% trans "Advanced Search" %}</h1>
-<form action="{% url telemeta-search %}" id="searchform">{% csrf_token %}
+<form action="{% url 'telemeta-search' %}" id="searchform">{% csrf_token %}
<fieldset>
<p>
<ul>
{% block trainings %}
{% for t in trainings %}
-<li><a href="{% url teleforma-users t.id iej.id course.id %}">{{ t.code|lower|capfirst }} - {{ t.period|lower|capfirst }}</a></li>
+<li><a href="{% url 'teleforma-users' t.id iej.id course.id %}">{{ t.code|lower|capfirst }} - {{ t.period|lower|capfirst }}</a></li>
{% endfor %}
{% endblock trainings %}
</ul>
<ul>
{% block iej %}
{% for i in iejs %}
-<li><a href="{% url teleforma-users training.id i.id course.id %}">{{ i.name|lower|capfirst }}</a></li>
+<li><a href="{% url 'teleforma-users' training.id i.id course.id %}">{{ i.name|lower|capfirst }}</a></li>
{% endfor %}
{% endblock iej %}
</ul>
<ul>
{% block courses %}
{% for c in courses %}
-<li><a href="{% url teleforma-users training.id iej.id c.id %}">{{ c }}</a></li>
+<li><a href="{% url 'teleforma-users' training.id iej.id c.id %}">{{ c }}</a></li>
{% endfor %}
{% endblock courses %}
</ul>
{% if users %}
<div class="module_action">
-<a href="{% url postman_write users|to_recipients %}" class="component_icon button" id="action_orange">{% trans "Grouped message" %}</a>
+<a href="{% url 'postman_write' users|to_recipients %}" class="component_icon button" id="action_orange">{% trans "Grouped message" %}</a>
</div>
{% endif %}
{% if user.is_staff %}
<div style="float:right;">
-<a href="{% url teleforma-users-export training.id iej.id course.id %}" class="component_icon button icon_csv">XLS Export</a>
+<a href="{% url 'teleforma-users-export' training.id iej.id course.id %}" class="component_icon button icon_csv">XLS Export</a>
</div>
{% endif %}
# Authors: Guillaume Pellerin <yomguy@parisson.com>
import os.path
-from django.conf.urls.defaults import *
-from django.views.generic import *
-from django.views.generic.base import *
+from django.conf.urls import patterns, url, include
+from django.conf import settings
+from django.views.generic.base import RedirectView
+from django.views.generic.list import ListView
from teleforma.models import *
from teleforma.views import *
from telemeta.views import *