'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
+ 'pagination.middleware.PaginationMiddleware',
)
ROOT_URLCONF = 'example.urls'
'teleforma',
'sorl.thumbnail',
'django_extensions',
+ 'pagination',
+ 'postman',
)
TEMPLATE_CONTEXT_PROCESSORS = (
EMAIL_HOST = 'localhost'
DEFAULT_FROM_EMAIL = 'webmaster@parisson.com'
+POSTMAN_AUTO_MODERATE_AS=True
# TeleForma
(r'^', include('teleforma.urls')),
+ # Postman
+ (r'^messages/', include('postman.urls')),
+
# Languages
(r'^i18n/', include('django.conf.urls.i18n')),
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
color: #333;
background: #FFF;
margin: 0em;
+ background:no-repeat url(../images/bg_yt.png) 0 0;
+ background-color:#ebebeb;
+ background-repeat:repeat
}
/*a:link, a:visited {
color: #000000;
font-weight: bold;
display: inline;
- font-size: 120%;
+ font-size: 120%;
}
#content h3 {
color: #000000;
}
#collection_player {
- background: transparent;
+ background: transparent;
/* background-image: url(../images/grid_bg_2.png); */
}
#collection_player .title {
- padding: 2px 5px 7px 5px;
+ padding: 2px 5px 7px 5px;
}
overflow-y: scroll;
width: 100%;
}
-
+
.analyzer-title {
background-color: #f2f2f2;
border-radius: 8px 8px 8px 8px;
}
#searchform p {
- background-color: #fff;
+ background-color: transparent;
padding: .5em 0;
}
#searchform label {
/* Drop Down Menus */
-.clear {clear:both}
+.clear {clear:both}
#nav {
margin:0;
padding:0;
list-style:none;
-}
+}
/* make the LI display inline */
/* it's position relative so that position absolute */
/* can be used in submenu */
#nav li {
-display:inline-block;
+display:inline-block;
position:relative;
z-index:500;
}
-
+
/* this is the parent menu */
#nav li a {
display:block;
color: #FFF;
width:100%;
}
-
+
#nav ul li {
width: 100%;
float:left;
border-bottom:0px solid #fff;
}
-
+
/* display block will make the link fill the whole area of LI */
#nav ul a {
- display:block;
+ display:block;
height:15px;
padding: 5px 5px;
font-size: 11px;
border-top-right-radius: 0px 0px;
border-bottom-width: 0px;
}
-
+
#nav ul a:hover {
background-color: #FFF ;
color: #000000 ;
line-height: 1.4em;
border-bottom: 1px dotted #aaa;
color: #000000;
+
}
.with-rightcol .extraInfos h4 {
margin-right: 395px;
color: #000000 !important;
text-decoration: none;
margin: 0;
- background: #fff url(more.png) no-repeat left top;
+ background: #fff url(images/more.png) no-repeat left top;
background-position: 0 -16px;
padding-bottom: 2px;
padding-left: 16px;
border-bottom: none !important;
outline: none;
+ background: transparent;
}
.extraInfos h4 a:hover {
background-color: transparent;
margin-bottom: .3em;
padding: .3em 0;
font-size: 1em;
- background-color: #fff;
+ background-color: transparent;
border-bottom: 1px solid #aaa;
color: #333;
font-weight: bold;
table.listing {
border-spacing: 0;
+ padding: 0em 1em 1em 2em;
}
.fullpage table.listing {
width: 100%;
- font-size: 105%;
+ font-size: 100%;
}
-table.listing th {
+table.listing th, table.listing thead {
text-align: left;
padding: 0 14em .1em 0;
- font-size: 1em;
+ font-size: 0.8125em;
+ font-weight: normal;
}
-table.listing th, table.listing td {
- font-size: 0.8em;
+
+table.listing th, table.listing thead, table.listing td {
+ font-size: 0.8125em;
border-bottom: 1px solid #dfdfdf;
+ font-weight: normal;
}
table.listing thead { background: #e8eaf0 }
table.listing thead th {
table.listing tbody tr:hover { background: #f7f8fa !important }
table td.error {
- color: red;
+ color: red;
font-weight: bold;
}
.infos li.error{
- color: red;
+ color: red;
font-weight: bold;
font-size: 110%;
}
#module-set .module {
border: 1px solid #000;
background-image: url(../images/grid_bg_2.png);
- padding: 0.3em 0.8em 0.8em 0.8em;
+ padding: 0.3em 0.4em 0.4em 0.4em;
margin: 3.5em 0em 1.5em 1.5em;
-moz-border-radius: 8px 8px 8px 8px;
-webkit-border-radius: 8px 8px 8px 8px;
#module-set .module h3 {
color: #FFF;
font-size: 1.1em;
- font-weight: bold;
+ font-weight: bold;
}
#module-set .module a:hover {
-moz-border-radius: 1ex;-webkit-border-radius: 1ex;border-radius: 1ex;
background-image: url('../images/ok.png');
}
-.markerdiv{
+.markerdiv{
border: 1px solid #aaaaaa;
margin-bottom: 1ex;
-moz-border-radius: 1e;
}
.icon_edit{
- background-image: url('../images/edit_page.png');
+ background-image: url('../images/edit_page.png');
}
.icon_copy{
background-image: url('../images/copy_page.png');
border-top: 1px dotted #000000;
}
-.course_title {
- border-bottom:1px solid #6A0307;
- color:#FFFFFF;
- background-image: url(../images/grid_bg_2.png);
- -moz-border-radius: 8px 8px 8px 8px;
- -webkit-border-radius: 8px 8px 8px 8px;
- border-radius: 8px 8px 8px 8px;
- }
-
#module-set-left {
float: left;
clear: left;
padding: 1.3em 0.8em 0.8em 0em;
}
-
+
#module-set-left .module {
border: 1px solid #000;
background-image: url(../images/grid_bg_2.png);
- padding: 0em 0.8em 0em 0.8em;
+ padding: 0.3em 0.4em 0.4em 0.4em;
margin: 0em 0em 1.5em 0em;
-moz-border-radius: 8px 8px 8px 8px;
-webkit-border-radius: 8px 8px 8px 8px;
border-radius: 8px 8px 8px 8px;
}
-
+
#module-set-left .module h3 {
color: #FFF;
font-size: 1.1em;
font-weight: bold;
}
-#module-set-left .module ul {
- margin: 0em 0em 0.8em 0.5em;
- font-size: 1em;
+#module-set-left .module ul {
+ margin: 0em 0em 0em 0.5em;
+ font-size: 0.8125em;
background-color: #FFF;
color: #0000 ;
+ font-weight: bold;
}
#module-set-left .module a {
float: right;
width:68%;
}
-
\ No newline at end of file
+
+.course {
+ margin: 0em 0em 2em 0em;
+ background-color: #FFF;
+ -moz-border-radius: 8px 8px 8px 8px;
+ -webkit-border-radius: 8px 8px 8px 8px;
+ border-radius: 8px 8px 8px 8px;
+
+ }
+
+
+.course_title {
+ color:#FFFFFF;
+ background-image: url(../images/grid_bg_2.png);
+ -moz-border-radius: 8px 8px 0px 0px;
+ -webkit-border-radius: 8px 8px 0px 0px;
+ border-radius: 8px 8px 0px 0px;
+ padding: 0.3em 0.8em 0.3em 0.8em;
+ font-weight: bold;
+ font-size: 1.2em;
+ }
+
+.course_media {
+ background-color: transparent;
+ background-image: url(../images/grid_bg_2.png);
+ margin: 0em 0em 2em 0em;
+ -moz-border-radius: 8px 8px 8px 8px;
+ -webkit-border-radius: 8px 8px 8px 8px;
+ border-radius: 8px 8px 8px 8px;
+/* border: 2px solid #CCC; */
+ }
+
+.media_infos {
+ background-color: #FFF;
+ padding: 0.3em 0.8em 0.3em 0.8em;
+ }
+
+.video {
+ background-color: transparent;
+ margin-left: auto;
+ margin-right: auto;
+ width: 360px;
+ padding: 1em 1em 1em 1em;
+ }
+
+.audio {
+ padding: 1em 1em 1em 1em;
+ background-color: transparent;
+ margin-left: auto;
+ margin-right: auto;
+ width: 550px;
+ }
title = CharField(_('title'), max_length=255)
description = CharField(_('description'), max_length=255, blank=True)
category = ForeignKey('Category', related_name='course', verbose_name=_('category'))
- public_id = CharField(_('public_id'), max_length=255, blank=True)
+ code = CharField(_('code'), max_length=255)
def __str__(self):
return self.department.name + ' - ' + self.category.name + ' - ' + self.title
class Training(Model):
+ code = CharField(_('code'), max_length=255)
name = CharField(_('name'), max_length=255, blank=True)
courses = ManyToManyField('Course', related_name="training", verbose_name=_('courses'),
blank=True, null=True)
+ synthesis_note = BooleanField(_('synthesis note'))
+ obligation = BooleanField(_('obligation'))
+
def __str__(self):
return self.name
class Procedure(Model):
name = CharField(_('name'), max_length=255, blank=True)
+ code = CharField(_('code'), max_length=255)
def __str__(self):
return self.name
class Speciality(Model):
name = CharField(_('name'), max_length=255, blank=True)
+ code = CharField(_('code'), max_length=255)
def __str__(self):
return self.name
verbose_name = _('speciality')
+class Oral(Model):
+
+ name = CharField(_('name'), max_length=255, blank=True)
+ code = CharField(_('code'), max_length=255)
+
+ def __str__(self):
+ return self.name
+
+ class Meta:
+ db_table = app_label + '_' + 'oral'
+ verbose_name = _('oral')
+
+
class Student(Model):
user = ForeignKey(User, related_name='student', verbose_name=_('user'), unique=True )
verbose_name=_('oral speciality'), blank=True, null=True)
written_speciality = ForeignKey('Speciality', related_name='student_written_spe',
verbose_name=_('written speciality'), blank=True, null=True)
- oral_1 = CharField(_('oral 1'), max_length=255, blank=True)
- oral_2 = CharField(_('oral 2'), max_length=255, blank=True)
-
+ oral_1 = ForeignKey('Oral', related_name='student_oral_1',
+ verbose_name=_('oral 1'), blank=True, null=True)
+ oral_2 = ForeignKey('Oral', related_name='student_oral_2',
+ verbose_name=_('oral 1'), blank=True, null=True)
def __str__(self):
return self.user.username
--- /dev/null
+{% extends "postman/base_folder.html" %}
+{% load i18n %}
+{% block pm_folder_title %}{% trans "Archived Messages" %}{% endblock %}
+{% block pm_archive_button %}{% endblock %}
+{% block pm_undelete_button %}{% endblock %}
+{% block pm_footer_info %}
+<p>{% trans "Messages in this folder will never be removed. You can use this folder for long term storage." %}</p>
+{% endblock %}
\ No newline at end of file
--- /dev/null
+{% extends "telemeta/base.html" %}
+{% load i18n %}{% load postman_tags %}
+
+{% block title %}
+<img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" />
+{% trans "Messages"%}
+{% endblock %}
+
+
+
+{% block title_buttons %}
+<div id="postman_menu" style="padding-left: 20px;">
+{% postman_unread as unread_count %}
+<a href="{% url postman_inbox %}" class="component_icon button icon_edit">{% trans "Inbox" %}{% if unread_count %} <strong>({{ unread_count }})</strong>{% endif %}</a></li>
+<a href="{% url postman_sent %}" class="component_icon button icon_edit">{% trans "Sent Messages" %}</a>
+<a href="{% url postman_write %}" class="component_icon button icon_edit">{% trans "Write" %}</a>
+<a href="{% url postman_archives %}" class="component_icon button icon_edit">{% trans "Archives" %}</a>
+<a href="{% url postman_trash %}" class="component_icon button icon_edit">{% trans "Trash" %}</a>
+</div>
+{% endblock %}
\ No newline at end of file
--- /dev/null
+{% extends "postman/base.html" %}
+{% load i18n postman_tags %}{% load pagination_tags %}
+
+{% block content %}
+
+<div id="postman">
+<h1>{% block pm_folder_title %}{% endblock %}</h1>
+{% autopaginate pm_messages %}
+{% if invalid_page %}
+<p>{% trans "Sorry, this page number is invalid." %}</p>
+{% else %}
+
+{% if pm_messages %}
+<br /><br />
+{% block pm_by_modes %}<div id="pm_by_modes">
+<a href="{{ by_conversation_url }}" class="component_icon button icon_filter">{% trans "by conversation" %}</a>
+<a href="{{ by_message_url }}" class="component_icon button icon_filter">{% trans "by message" %}</a>
+</div>{% endblock pm_by_modes %}
+<br />
+
+<form action="{% block pm_form_action %}{% endblock %}" method="post">{% csrf_token %}
+
+<table id="pm_messages" class="listing" >
+ <thead>
+ <tr>
+ <th>{% trans "Action" %}</th>
+{% block pm_sender_header %} <th><a href="{% postman_order_by sender %}">{% trans "Sender" %}</a></th>{% endblock %}
+{% block pm_recipient_header %} <th><a href="{% postman_order_by recipient %}">{% trans "Recipient" %}</a></th>{% endblock %}
+ <th><a href="{% postman_order_by subject %}">{% trans "Subject" %}</a></th>
+ <th><a href="{% postman_order_by date %}">{% block pm_date %}{% trans "Date" %}{% endblock %}</a></th>
+ </tr>
+ </thead>
+ <tbody>{% for message in pm_messages %}
+ <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>{{ message.obfuscated_sender|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}</td>{% endblock %}
+{% block pm_recipient_cell %} <td>{{ message.obfuscated_recipient|or_me:user }}{% if message.count %} ({{ message.count }}){% endif %}</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 }}">
+ {% include "postman/inc_subject_ex.html" %}
+ </a>
+{% endblock %}
+ {% if message.is_replied %}</em>{% endif %}{% if message.is_new %}</strong>{% endif %}</td>
+ <td>{{ message.sent_at|compact_date:_("g:i A,M j,n/j/y") }}</td>
+ </tr>{% endfor %}
+ </tbody>
+</table>
+
+<br />
+{% block pm_form_buttons %}<span id="pm_buttons">
+{% block pm_delete_button %}<button type="submit" onclick="this.form.action='{% url postman_delete %}'">{% trans "Delete" %}</button>{% endblock %}
+{% block pm_archive_button %}<button type="submit" onclick="this.form.action='{% url postman_archive %}'">{% trans "Archive" %}</button>{% endblock %}
+{% block pm_undelete_button %}<button type="submit" onclick="this.form.action='{% url postman_undelete %}'">{% trans "Undelete" %}</button>{% endblock %}
+</span>{% endblock %}
+
+</form>
+{% paginate %}
+{% else %}
+<p>{% trans "No messages." %}</p>
+{% endif %}
+{% endif %}
+{% block pm_footer_info %}{% endblock %}
+</div>
+{% endblock content %}
\ No newline at end of file
--- /dev/null
+{% extends "postman/base.html" %}
+{% load i18n %}
+{% block extrahead %}{{ block.super }}
+{% if is_autocompleted %}
+{# using the available admin jQuery is enough #}
+<script type="text/javascript" src="{% load adminmedia %}{% admin_media_prefix %}js/jquery.min.js"></script>
+{# <script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.min.js"></script> #}
+<script type="text/javascript" src="{{ MEDIA_URL }}js/jquery.autocomplete.min.js"></script>
+<link href="{{ MEDIA_URL }}css/jquery.autocomplete.css" type="text/css" media="all" rel="stylesheet" />
+{% endif %}
+{% endblock %}
+{% block content %}
+<div id="postman">
+<h1>{% block pm_write_title %}{% endblock %}</h1>
+<form action="{% if next_url %}?next={{ next_url|urlencode }}{% endif %}" method="post">{% csrf_token %}
+<table>
+{% block pm_write_recipient %}{% endblock %}
+{{ form.as_table }}
+</table>
+<button type="submit">{% trans "Send" %}</button>
+</form>
+</div>
+{% endblock %}
\ No newline at end of file
--- /dev/null
+{% load i18n %}{% autoescape off %}{% trans "Dear user," %}
+{% if action == 'rejection' %}
+{% blocktrans with object.sent_at|date:"DATETIME_FORMAT" as date and object.obfuscated_recipient as recipient %}On {{ date }}, you asked to send a message to the user '{{ recipient }}'.{% endblocktrans %}
+
+{% trans "Your message has been rejected by the moderator" %}{% if object.moderation_reason %}{% trans ", for the following reason:" %}
+ {{ object.moderation_reason }}{% else %}.{% endif %}
+
+{% else %}{# 'acceptance' #}
+{% if object.parent_id %}{% if object.parent.sender_id == object.recipient_id %}{% blocktrans with object.parent.sent_at|date:"DATETIME_FORMAT" as date and object.obfuscated_sender as sender %}On {{ date }}, you sent a message to the user '{{ sender }}'.{% endblocktrans %}
+{% trans "Your correspondent has given you an answer." %}
+{% else %}{% blocktrans with object.obfuscated_sender as sender %}You have received a copy of a response from the user '{{ sender }}'.{% endblocktrans %}
+{% endif %}
+{% else %}{% blocktrans with object.obfuscated_sender as sender %}You have received a message from the user '{{ sender }}'.{% endblocktrans %}
+{% endif %}
+{% endif %}{# 'acceptance' #}
+{% trans "Thank you again for your interest in our services." %}
+{% trans "The site administrator" %}
+
+{% blocktrans %}Note: This message is issued by an automated system.
+Do not reply, this would not be taken into account.{% endblocktrans %}{% endautoescape %}
\ No newline at end of file
--- /dev/null
+{% load i18n %}{% autoescape off %}{% blocktrans with object.subject as subject and site.name as sitename %}Message "{{ subject }}" on the site {{ sitename }}{% endblocktrans %}{% endautoescape %}
\ No newline at end of file
--- /dev/null
+{% load i18n %}{% autoescape off %}{% trans "Dear visitor," %}
+{% if action == 'rejection' %}
+{% blocktrans with object.sent_at|date:"DATETIME_FORMAT" as date and object.recipient as recipient %}On {{ date }}, you asked to send a message to the user '{{ recipient }}'.{% endblocktrans %}
+
+{% trans "Your message has been rejected by the moderator" %}{% if object.moderation_reason %}{% trans ", for the following reason:" %}
+ {{ object.moderation_reason }}{% else %}.{% endif %}
+
+{% trans "As a reminder, please find below the content of your message." %}
+{% else %}{# 'acceptance' #}
+{% blocktrans with object.parent.sent_at|date:"DATETIME_FORMAT" as date and object.sender as sender %}On {{ date }}, you sent a message to the user '{{ sender }}'.{% endblocktrans %}
+{% trans "Please find below the answer from your correspondent." %}
+{% endif %}
+
+{% trans "Thank you again for your interest in our services." %}
+{% trans "For more comfort, we encourage you to open an account on the site." %}
+{% trans "The site administrator" %}
+
+{% blocktrans %}Note: This message is issued by an automated system.
+Do not reply, this would not be taken into account.{% endblocktrans %}
+-------------------------------------------------------
+{{ object.body }}
+-------------------------------------------------------{% endautoescape %}
\ No newline at end of file
--- /dev/null
+{% load i18n %}{% autoescape off %}{% blocktrans with object.subject as subject and site.name as sitename %}Message "{{ subject }}" on the site {{ sitename }}{% endblocktrans %}{% endautoescape %}
\ No newline at end of file
--- /dev/null
+{% extends "postman/base_folder.html" %}
+{% load i18n %}
+{% block pm_folder_title %}{% trans "Received Messages" %}{% endblock %}
+{% block pm_undelete_button %}{% endblock %}
+{% block pm_recipient_header %}{% endblock %}
+{% block pm_date %}{% trans "Received" %}{% endblock %}
+{% block pm_recipient_cell %}{% endblock %}
--- /dev/null
+{% comment %}
+This file is intended to be included, such as in postman/base_folder.html:
+ {% include "postman/inc_subject_ex.html" %}
+
+It provides an extended subject, as a replacement to a simple {{ message.subject }} tag.
+Enhancements are:
+* limit the subject length to a few words
+* if there is still room up to a maximum number of words, then add the very first words of the body,
+ in a grey style.
+
+Examples:
+With a total of at most 12 words, and 5 words of subject.
+With body: "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod."
+
+With subject: "a subject of great interest for you":
+"a subject of great interest ... - Lorem ipsum dolor sit amet, consectetur ..."
+
+With subject: "a great interest":
+"a great interest - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed ..."
+
+{% endcomment %}{% load postman_tags %}{% with message.subject|truncatewords:5 as truncated_subject %}{{ truncated_subject }}
+{% with truncated_subject|wordcount as subject_wc %}{% with 12|sub:subject_wc as wc %}{% if message.body and wc > 0 %} - <span style="color: grey">{{ message.body|truncatewords:wc }}</span>{% endif %}{% endwith %}{% endwith %}{% endwith %}
\ No newline at end of file
--- /dev/null
+{% extends "postman/base_write.html" %}
+{% load i18n %}
+{% block pm_write_title %}{% trans "Reply"%}{% endblock %}
+{% block pm_write_recipient %}<tr><th><label>{% trans "Recipient" %}:</label></th><td>{{ recipient }}</td></tr>{% endblock %}
\ No newline at end of file
--- /dev/null
+{% extends "postman/base_folder.html" %}
+{% load i18n %}
+{% block pm_folder_title %}{% trans "Sent Messages" %}{% endblock %}
+{% block pm_undelete_button %}{% endblock %}
+{% block pm_sender_header %}{% endblock %}
+{% block pm_date %}{% trans "Sent" %}{% endblock %}
+{% block pm_sender_cell %}{% endblock %}
--- /dev/null
+{% extends "postman/base_folder.html" %}
+{% load i18n %}
+{% block pm_folder_title %}{% trans "Deleted Messages" %}{% endblock %}
+{% block pm_delete_button %}{% endblock %}
+{% block pm_archive_button %}{% endblock %}
+{% block pm_subject %}{# no link #}
+ {% include "postman/inc_subject_ex.html" %}
+{% endblock %}
+{% block pm_footer_info %}
+<p>{% trans "Messages in this folder can be removed from time to time. For long term storage, use instead the archive folder." %}</p>
+{% endblock %}
\ No newline at end of file
--- /dev/null
+{% extends "postman/base.html" %}
+{% load i18n %}{% load postman_tags %}
+{% block content %}
+<div id="postman">
+<h1>{% if pm_messages|length > 1 %}{% trans "Conversation" %}{% else %}{% trans "Message" %}{% endif %}</h1>
+<br /><br />
+{% 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">
+ <span class="pm_sender">{{ message.obfuscated_sender|or_me:user }}</span> »
+ <span class="pm_recipient">{{ message.obfuscated_recipient|or_me:user }}</span> |
+ <span class="pm_date">{{ message.sent_at|date:"DATETIME_FORMAT"}}</span> |
+ <span class="pm_subject">{{ message.subject }}</span>
+{% if message.is_rejected %} <div class="pm_status">{% trans "Rejected" %}{% if message.moderation_reason %}{% trans ":" %} {{ message.moderation_reason }}{% endif %}</div>{% endif %}
+ </div>
+ <hr />
+ <div class="pm_body">{{ message.body|linebreaksbr }}</div>
+</div>
+<br />
+{% if forloop.last %}
+<form action="" method="post">{% csrf_token %}
+<input type="hidden" {% if message.thread_id %}name="tpks" value="{{ message.thread_id }}"{% else %}name="pks" value="{{ message.pk }}"{% endif %} />
+<a href="{{ next_url }}">{% trans "Back" %}</a>
+<span id="pm_buttons">
+<button type="submit" onclick="this.form.action='{% url postman_delete %}?next={{ next_url|urlencode }}'">{% trans "Delete" %}</button>
+{% if not archived %}<button type="submit" onclick="this.form.action='{% url postman_archive %}?next={{ next_url|urlencode }}'">{% trans "Archive" %}</button>{% endif %}
+</span>
+{% if reply_to_pk %}<a 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 action="{% url postman_reply reply_to_pk %}?next={{ next_url|urlencode }}" method="post">{% csrf_token %}
+<div id="pm_reply">{{ form.body }}</div>
+<button type="submit">{% trans 'Reply' %}</button>
+</form>{% endif %}
+{% endif %}
+{% endfor %}
+</div>
+{% endblock %}
\ No newline at end of file
--- /dev/null
+{% extends "postman/base_write.html" %}
+{% load i18n %}
+{% block pm_write_title %}{% trans "Write"%}{% endblock %}
\ No newline at end of file
{% block course %}
-<table class="listing" style="width:100%;margin-top: 1em">
-<tr>
-<td class="course_title" style="font-size: 120%;">{{ course.title }}{% if course.description %} - {{ course.description }}{% endif %}</td>
-</tr>
-</table>
+<div class="course">
+<div class="course_title">{{ course.title }}{% if course.description %} - {{ course.description }}{% endif %}
+</div>
{% block document %}
{% with course as course and %}
{% endwith %}
{% endblock %}
-
+</div>
{% endblock course %}
{% block course %}
{% for course in object_list %}
-
- <table class="listing" style="width:100%;margin-top: 1em">
- <tr>
- <td class="course_title" style="font-size: 120%;">{{ course.title }}{% if course.description %} - {{ course.description }}{% endif %}</td>
- </tr>
- </table>
+ <div class="course">
+ <div class="course_title">{{ course.title }}{% if course.description %} - {{ course.description }}{% endif %}
+ </div>
{% block document %}
{% with course as course and %}
{% include "teleforma/inc/conference_list.html" %}
{% endwith %}
{% endblock %}
-
+ </div>
{% endfor %}
{% endblock course %}
<tbody>
{% 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 teleforma-media-detail media.id %}">{{ media.item.title }}</a></td>
<td>{{ media.item.description }}</td>
<td>{{ media.date_added }}</td>
</tr>
{% endif %}
{% if user.is_authenticated %}
- <li><a href="{% url teleforma-messages %}" class="green">{% trans "Messages" %}</a></li>
+ <li><a href="/messages" class="green">{% trans "Messages" %}</a></li>
<li><a href="{% url telemeta-users %}" class="yellow">{% trans "Users" %}</a></li>
-
+
<li><a href="{% url telemeta-search-criteria %}" class="orange">{% trans "Advanced search" %}</a></li>
{% if user.is_staff %}
-
+
<li><a href="#archives#" class="red">{% trans "Archives" %}</a>
<ul>
<li><a href="{% url telemeta-fonds %}">{% trans "Fonds" %}</a></li>
<li><a href="{% url telemeta-items %}">{% trans "Items" %}</a></li>
</ul>
</li>
-
+
<li><a href="{% url telemeta-admin-general %}" class="violet">{% trans "Admin" %}</a></li>
{% endif %}
<li><a href="{% url telemeta-logout %}">{% trans "Sign out" %}</a></li>
</ul>
</li>
-
+
{% endif %}
{% endif %}
<table width="100%">
<tr>
<td>
- <a id="telemeta_powered" href="{% telemeta_url %}" target="_blank"><img src="{% url telemeta-images "logo_mini_2.png" %}"
+ <a id="telemeta_powered" href="{% telemeta_url %}" target="_blank"><img src="{% url telemeta-images "logo_mini_2.png" %}"
alt="Telemeta Powered"/></a>
<p class="left">
{% trans "Powered by" %} <a href="{% telemeta_url %}" target="_blank"><strong>Telemeta {% telemeta_version %}</strong></a><br />
urlpatterns = patterns('',
- url(r'^desk/courses/$', ListView.as_view(model=Course, template_name='teleforma/courses.html'), name="teleforma-courses"),
-
+ url(r'^desk/courses/$', CoursesView.as_view(), name="teleforma-courses"),
url(r'^desk/courses/(?P<pk>.*)$', CourseView.as_view(), name="teleforma-course-detail"),
-
- url(r'^messages/$', ListView.as_view(model=Course, template_name='teleforma/courses.html'), name="teleforma-messages"),
+ url(r'^desk/medias/(?P<pk>.*)$', MediaView.as_view(), name="teleforma-media-detail"),
# CSS+Images (FIXME: for developement only)
url(r'^teleforma/css/(?P<path>.*)$', 'django.views.static.serve',
from django.http import HttpResponse, HttpResponseRedirect
from django.http import Http404
from django.shortcuts import render_to_response, redirect, get_object_or_404
-from django.views.generic import list_detail
-from django.views.generic import DetailView
+from django.views.generic import *
from django.views.generic.base import *
from django.conf import settings
from django.contrib import auth
from teleforma.models import *
+from telemeta.views.base import *
+
def render(request, template, data = None, mimetype = None):
return render_to_response(template, data, context_instance=RequestContext(request),
def get_context_data(self, **kwargs):
context = super(CourseView, self).get_context_data(**kwargs)
context['courses'] = Course.objects.all()
+ context['searches'] = Search.objects.filter(username=self.request.user)
+ return context
+
+class CoursesView(ListView):
+
+ model = Course
+ template_name='teleforma/courses.html'
+
+ def get_context_data(self, **kwargs):
+ context = super(CoursesView, self).get_context_data(**kwargs)
+ context['courses'] = Course.objects.all()
+ context['searches'] = Search.objects.filter(username=self.request.user)
return context
+class MediaView(DetailView):
+
+ model = Media
+ template_name='teleforma/course_media.html'
+ def get_context_data(self, **kwargs):
+ context = super(MediaView, self).get_context_data(**kwargs)
+ context['courses'] = Course.objects.all()
+ media = self.get_object()
+ view = ItemView()
+ context['mime_type'] = view.item_analyze(media.item)
+ context['course'] = media.course
+ context['item'] = media.item
+ context['searches'] = Search.objects.filter(username=self.request.user)
+ return context