INSTALLED_APPS = (
-
+ 'jazzmin',
# 'south',
'django.contrib.auth',
'django.contrib.contenttypes',
"mezzanine.galleries",
# "mezzanine.twitter",
'teleforma',
- 'jazzmin',
'django.contrib.admin',
'jsonrpc',
'sorl.thumbnail',
#FILE_PROTECTION_METHOD = 'xsendfile'
-TELEFORMA_ORGANIZATION = 'Pré-Barreau - CRFPA'
-TELEFORMA_SUBJECTS = ('Barreau', 'CRFPA', 'e-learning')
-TELEFORMA_DESCRIPTION = "E-learning Pré-Barreau - CRFPA"
-TELEFORMA_E_LEARNING_TYPE = 'CRFPA'
+TELEFORMA_ORGANIZATION = 'Pro-Barreau'
+TELEFORMA_SUBJECTS = ('Barreau', 'e-learning')
+TELEFORMA_DESCRIPTION = "E-learning Pro-Barreau"
+TELEFORMA_E_LEARNING_TYPE = 'Pro-Barreau'
TELEFORMA_GLOBAL_TWEETER = False
TELEFORMA_PERIOD_TWEETER = True
TELEFORMA_EXAM_TOPIC_DEFAULT_DOC_TYPE_ID = 4
TELEFORMA_EXAM_SCRIPT_SERVICE_URL = '/webviewer/teleforma.html'
EMAIL_HOST = 'angus.parisson.com'
-DEFAULT_FROM_EMAIL = 'crfpa@pre-barreau.com'
-SERVER_EMAIL = 'crfpa@pre-barreau.com'
+DEFAULT_FROM_EMAIL = 'e-learning@pro-barreau.com'
+SERVER_EMAIL = 'webmaster@parisson.com'
+REPORT_TO_EMAIL = ('kostya.rilov@pre-barreau.com', 'alexia.dcruz@pro-barreau.com')
+ADMIN_USERNAME = 'Pro-Barreau'
EMAIL_SUBJECT_PREFIX = '[' + TELEFORMA_ORGANIZATION + '] '
TELECASTER_LIVE_STREAMING_PROTOCOL = 'https'
POSTMAN_SHOW_USER_AS = show_user_as
-#THUMBNAIL_FORCE_OVERWRITE = True
+# MEZZANINE
GRAPPELLI_INSTALLED = False
+COMMENTS_NUM_LATEST = 5
JAZZMIN_SETTINGS = {
- "site_title": "CRFPA",
- "site_header": "CRFPA",
+ "site_title": "Probarreau - E-learning",
+ "site_header": "Probarreau",
"site_logo": "teleforma/images/logo_pb.png",
# # Links to put along the top menu
('_meta_title', models.CharField(blank=True, help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title')),
('description', models.TextField(blank=True, verbose_name='Description')),
('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')),
- ('created', models.DateTimeField(editable=False, null=True)),
- ('updated', models.DateTimeField(editable=False, null=True)),
('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
('_meta_title', models.CharField(blank=True, help_text='Optional title to be used in the HTML title tag. If left blank, the main title field will be used.', max_length=500, null=True, verbose_name='Title')),
('description', models.TextField(blank=True, verbose_name='Description')),
('gen_description', models.BooleanField(default=True, help_text='If checked, the description will be automatically generated from content. Uncheck if you want to manually set a custom description.', verbose_name='Generate description')),
- ('created', models.DateTimeField(editable=False, null=True)),
- ('updated', models.DateTimeField(editable=False, null=True)),
('status', models.IntegerField(choices=[(1, 'Draft'), (2, 'Published')], default=2, help_text='With Draft chosen, will only be shown for admin users on the site.', verbose_name='Status')),
('publish_date', models.DateTimeField(blank=True, db_index=True, help_text="With Published chosen, won't be shown until this time", null=True, verbose_name='Published from')),
('expiry_date', models.DateTimeField(blank=True, help_text="With Published chosen, won't be shown after this time", null=True, verbose_name='Expires on')),
--- /dev/null
+# Generated by Django 3.2.3 on 2021-12-22 17:25
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('teleforma', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='conference',
+ name='created',
+ field=models.DateTimeField(editable=False, null=True),
+ ),
+ migrations.AddField(
+ model_name='conference',
+ name='updated',
+ field=models.DateTimeField(editable=False, null=True),
+ ),
+ migrations.AddField(
+ model_name='seminar',
+ name='created',
+ field=models.DateTimeField(editable=False, null=True),
+ ),
+ migrations.AddField(
+ model_name='seminar',
+ name='updated',
+ field=models.DateTimeField(editable=False, null=True),
+ ),
+ ]
verbose_name=_('courses'),
blank=True)
- def __unicode__(self):
+ def __str__(self):
try:
return self.user.last_name + ' ' + self.user.first_name
except:
name = CharField(_('name'), max_length=255)
description = CharField(_('description'), max_length=255, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta(MetaCore):
signature = models.ImageField(_('Signature image'), upload_to='images/%Y/%m/%d',
blank=True, null=True, max_length=1024)
- def __unicode__(self):
+ def __str__(self):
return self.name
@property
verbose_name_plural = _('locations')
ordering = ['name']
- def __unicode__(self):
+ def __str__(self):
return self.name
code = models.CharField(_('identifier'), max_length=64, unique=True)
name = models.CharField(_('name'), max_length=150)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta(MetaCore):
name = CharField(_('name'), max_length=255)
description = CharField(_('description'), max_length=255, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta(MetaCore):
name = CharField(_('name'), max_length=255)
description = CharField(_('description'), max_length=255, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta(MetaCore):
notes = GenericRelation(Note)
- def __unicode__(self):
+ def __str__(self):
return self.title
@property
verbose_name=_('courses'),
blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta(MetaCore):
blank=True)
- def __unicode__(self):
+ def __str__(self):
if self.user.first_name or self.user.last_name:
return self.user.last_name + ' ' + self.user.first_name
else:
name = CharField(_('name'), max_length=255)
description = CharField(_('description'), max_length=255, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.organization.name + ' - ' + self.name
class Meta(MetaCore):
source_password = CharField(_('source password'), max_length=32)
admin_password = CharField(_('admin password'), max_length=32, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.host + ':' + self.port + ' - ' + self.type
class Meta(MetaCore):
url = 'https://' + self.server.host + ':' + str(self.server.port) + '/' + self.mount_point
return url
- def __unicode__(self):
+ def __str__(self):
if self.conference:
return self.conference.title
else:
description = CharField(_('description'), max_length=255, blank=True)
number = IntegerField(_('number'), blank=True, null=True)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta(MetaCore):
def set_mime_type(self):
self.mime_type = mimetypes.guess_type(self.file.path)[0]
- def __unicode__(self):
+ def __str__(self):
return self.full_title
@cached_property
else:
return self.mimetype
- def __unicode__(self):
+ def __str__(self):
if self.item.title:
return self.item.title + ' - ' + self.mime_type
else:
else:
self.mime_type = mime_type
- def __unicode__(self):
+ def __str__(self):
return self.full_title
@cached_property
def get_absolute_url(self):
return reverse('conference-view', kwargs={"pk": self.id})
- def __unicode__(self):
+ def __str__(self):
if self.professor:
list = [self.title, self.course.title,
self.session,
# chunk up the objects so we don't need to iterate over the whole list for each letter
chunks = {}
-
for obj in self.object_list:
if on:
- obj_str = getattr(obj, on).encode('utf8')
+ obj_str = getattr(obj, on)
else:
- obj_str = obj.encode('utf8')
+ obj_str = obj
if len(obj_str):
- letter = str.upper(obj_str[0])
+ letter = str.upper(str(obj_str[0]))
else:
letter = ''
name = CharField(_('name'), max_length=255)
description = CharField(_('description'), max_length=255, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta(MetaCore):
blank=True)
cost = FloatField(_('cost'), blank=True, null=True)
- def __unicode__(self):
+ def __str__(self):
code = self.code
if self.period:
code += ' - ' + self.period.name
options = ForeignKey('Course', related_name="options", verbose_name=_('options'),
blank=True, null=True, on_delete=models.SET_NULL)
- def __unicode__(self):
+ def __str__(self):
try:
return self.user.last_name + ' ' + self.user.first_name
except:
name = models.CharField(_('name'), max_length=255, blank=True)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta(MetaCore):
search_fields = {'description': 1, 'sub_title':2, 'index':1}
- def __unicode__(self):
+ def __str__(self):
if self.publish_date:
return ' - '.join([str(self.publish_date.year), self.course.title, str(self.rank), self.title])
else:
min_nchar = models.IntegerField(_('minimum numbers of characters'))
status = models.IntegerField(_('status'), choices=STATUS_CHOICES, default=3)
- def __unicode__(self):
+ def __str__(self):
return ' - '.join([str(self.seminar), self.title, str(self.rank)])
class Meta(MetaCore):
date_validated = models.DateTimeField(_('date validated'), null=True)
date_added = models.DateTimeField(_('date added'), auto_now_add=True, null=True)
- def __unicode__(self):
+ def __str__(self):
return ' - '.join([str(self.question), self.user.username, str(self.date_submitted)])
def validate(self):
document = models.ForeignKey(Document, related_name="testimonial_template",
verbose_name=_('template'), on_delete=models.CASCADE)
- def __unicode__(self):
+ def __str__(self):
return ' - '.join([self.organization.name, self.description])
class Meta(MetaCore):
self.title = self.get_title()
super(Testimonial, self).save(**kwargs)
- def __unicode__(self):
+ def __str__(self):
if self.title:
return self.title
else:
expiration_date = models.DateField(_('Expiration_date'), blank=True, null=True)
init_password = models.BooleanField(_('Password initialized'))
- def __unicode__(self):
+ def __str__(self):
try:
return self.user.last_name + ' ' + self.user.first_name
except:
date = models.DateTimeField(_('date added'), auto_now_add=True, null=True)
date_modified = models.DateTimeField(_('date modified'), blank=True, null=True)
- def __unicode__(self):
+ def __str__(self):
return ' - '.join([self.seminar.title, self.user.username, str(self.date), str(self.date_modified)])
class Meta(MetaCore):
validated = models.BooleanField(_('validated'))
date_validated = models.DateTimeField(_('date validated'), auto_now_add=True, null=True)
- def __unicode__(self):
+ def __str__(self):
return ' - '.join([str(self.quiz), self.user.username, str(self.date_validated)])
def validate(self):
<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 %}
<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 %}
<br /><br />
</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>
{% endif %}
{% block modules %}
<div class="module">
-<h3><a href="{% url teleforma-desk %}"><img src="{{ STATIC_URL }}teleforma/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "Answers" %}</a></h3>
+<h3><a href="{% url 'teleforma-desk' %}"><img src="{{ STATIC_URL }}teleforma/images/module_playlist.png" alt="playlists" style="vertical-align:middle" />{% trans "Answers" %}</a></h3>
<div style="background: white;">
<ul>
{% block courses %}
{% if user.is_authenticated %}
- <li><a href="{% url 'postman_inbox' %}" class="orange">{% trans "Contact us" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
+ <li><a href="{% url 'postman:inbox' %}" class="orange">{% trans "Contact us" %}{% if postman_unread_count %} ({{ postman_unread_count }}){% endif %}</a></li>
{% if user.is_staff %}
<li><a href="{% url 'teleforma-users' %}" class="yellow">{% trans "Users" %}</a></li>
<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.email }}</a></td>
- <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>
{% 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>
#paginate_by = 12
def get_queryset(self):
- return User.objects.all().select_related(depth=1).order_by('last_name')
+ return User.objects.all().select_related().order_by('last_name')
def get_context_data(self, **kwargs):
context = super(UsersView, self).get_context_data(**kwargs)
yield line.rstrip('\r\n')
file.close()
- def __unicode__(self):
+ def __str__(self):
file = open(self.filename, 'r')
data = file.read()
file.close()