LOGIN_REDIRECT_URL = reverse_lazy('teleforma-desk')
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
-EMAIL_HOST = 'smtp.numericable.fr'
+EMAIL_HOST = 'smtp.free.fr'
DEFAULT_FROM_EMAIL = 'webmaster@parisson.com'
SERVER_EMAIL = 'webmaster@parisson.com'
EMAIL_SUBJECT_PREFIX = '[' + TELEMETA_ORGANIZATION.decode('utf8') + '] '
POSTMAN_AUTO_MODERATE_AS = True
#FILE_PROTECTION_METHOD = 'xsendfile'
+
+GOOGLE_ANALYTICS_MODEL = True
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-07-08 15:43+0200\n"
+"POT-Creation-Date: 2012-07-09 11:47+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
#: models.py:526
msgid "Password initialized"
-msgstr ""
+msgstr "Mot de passe initialisé"
#: models.py:530
msgid "profile"
msgstr ""
#: templates/postman/email_user.txt:20
-#: templates/postman/email_user_init.txt:16
+#: templates/postman/email_user_init.txt:25
#: templates/postman/email_visitor.txt:16
msgid "The site administrator"
msgstr ""
msgstr "de"
#: templates/postman/email_user.txt:22
-#: templates/postman/email_user_init.txt:18
+#: templates/postman/email_user_init.txt:28
#: templates/postman/email_visitor.txt:18
msgid ""
"Note: This message is issued by an automated system.\n"
"Do not reply, this would not be taken into account."
msgstr ""
-#: templates/postman/email_user_init.txt:15
+#: templates/postman/email_user_init.txt:24
msgid "Best regards"
-msgstr ""
+msgstr "Cordialement"
-#: templates/postman/email_user_init.txt:16
+#: templates/postman/email_user_init.txt:25
msgid "of the"
msgstr "du"
#: templates/postman/email_user_subject_init.txt:1
#, python-format
-msgid "Initialization of your e-learning account at %(organization)s"
-msgstr "Initialisation de votre compte e-learning du %(organization)s"
+msgid "%(organization)s : initialization of your e-learning account"
+msgstr "%(organization)s : initialisation de votre compte e-learning"
#: templates/postman/email_visitor.txt:1
msgid "Dear visitor,"
msgstr "Conférences en direct"
#: templates/teleforma/inc/conference_list.html:15
-#: templates/teleforma/inc/document_list.html:17
+#: templates/teleforma/inc/document_list.html:20
#: templates/teleforma/inc/media_list.html:14
msgid "View"
msgstr ""
-#: templates/teleforma/inc/document_list.html:19
+#: templates/teleforma/inc/document_list.html:22
#: templates/teleforma/inc/media_list.html:17
msgid "Download"
msgstr "Télécharger"
-#: templates/teleforma/inc/document_list.html:30
+#: templates/teleforma/inc/document_list.html:36
msgid "No document"
msgstr "Aucun document"
msgstr "Se connecter en tant que"
#: templates/telemeta/profile_detail.html:107
-msgid "Password reinitialization"
-msgstr ""
+msgid "Password reset"
+msgstr "Réinitialisation du mot de passe"
#: templates/telemeta/search_criteria.html:5
#: templates/telemeta/search_criteria.html:76
from django.contrib.auth.tokens import default_token_generator
from django.template.defaultfilters import slugify
from django.template.loader import render_to_string
+from django.core.mail import send_mail, mail_admins
+from django.utils import translation
from telemeta.models import *
from telemeta.util.unaccent import unaccent
from teleforma.models import *
class Command(BaseCommand):
help = "Reset the password for all (active) users "
- message_template = 'postman/email_user_init.html'
- subject_template = 'postman/email_user_subject_init.html'
+ message_template = 'postman/email_user_init.txt'
+ subject_template = 'postman/email_user_subject_init.txt'
+ language_code = 'fr_FR'
- def init_password_email(self, user):
+ def init_password_email(self, user, profile):
site = Site.objects.get_current()
ctx_dict = {'site': site, 'organization': settings.TELEMETA_ORGANIZATION, 'usr': user}
- subject = render_to_string(subject_template, ctx_dict)
+ subject = render_to_string(self.subject_template, ctx_dict)
subject = ''.join(subject.splitlines())
- message = render_to_string(message_template, ctx_dict)
+ message = render_to_string(self.message_template, ctx_dict)
send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, [user.email], fail_silently=False)
- profile = user.get_profile()
profile.init_password = True
profile.save()
- mail_admins(subject, message)
def handle(self, *args, **options):
# users = User.objects.all()
+ translation.activate(self.language_code)
users = User.objects.filter(is_staff=True)
for user in users:
- profile = user.get_profile()
- if not profile.init_password and user.is_active:
- self.init_password_email(user)
+ profile = Profile.objects.get(user=user)
+ if profile:
+ profile.init_password = False
+ if not profile.init_password and user.is_active:
+ self.init_password_email(user, profile)
+ print user.username
{% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %}{% autoescape off %}{% trans "Hello" %} {{ usr.first_name }} {{ usr.last_name }},
-Suite à votre inscription à la formation estivale 2012 du Pré-Barreau, vous trouverez ci-dessous un lien vous invitant à choisir votre mot de passe à la plateforme e-learning.
+Suite à votre inscription à la formation estivale 2012 du Pré-Barreau, nous vous invitons à initialiser votre compte sur notre plateforme e-learning interactive et multi-média. Pour cela, merci de cliquer sur le lien suivant puis d'indiquez votre adresse e-mail :
-http://{{ site.name }}/account/reset_password
+http://{{ site.name }}/accounts/password_reset/
+
+Vous recevrez alors un second e-mail vous invitant à initialiser votre mot de passe personnel.
+Une fois la procédure accomplie, vous pourrez vous connecter à l'adresse suivante :
+
+http://{{ site.name }}
+
+à l'aide de votre nom d'utilisateur : {{ usr.username }}
+
+Cette plateforme vous permet d’accéder tout au long de votre formation aux différents documents - fascicules de cours (selon la formule choisie), fascicules d’actualisation, sujets et corrigés - ainsi qu’à l’ensemble de vos enseignements à la demande ou en direct. La messagerie intégrée vous donne aussi la possibilité de communiquer avec les administrateurs et les professeurs. Une page d'aide sera bientôt disponible pour vous assister lors de la découverte de ces nouveaux services.
-Cette plateforme vous permettra d’accéder tout au long de votre formation aux différents documents - fascicules de cours (selon la formule choisie), fascicules d’actualisation, sujets et corrigés - ainsi qu’à l’ensemble de vos enseignements. La messagerie intégrée vous permet de communiquer avec les administrateurs, les utilisateurs et le corps enseignant. Une page d'aide est également disponible pour vous assister lors de la découverte de ces nouveaux services.
Nous vous rappelons que votre formation commencera le vendredi 20 juillet 2012 par une séance de méthodologie à la note de synthèse (2h) et aux épreuves juridiques (2h).
Votre emploi du temps vous sera communiqué vers le 16 juillet.
+
{% trans "Best regards" %},
{% trans "The site administrator" %} {% trans "of the" %} {% organization %}
+
{% blocktrans %}Note: This message is issued by an automated system.
Do not reply, this would not be taken into account.{% endblocktrans %}{% endautoescape %}
-{% load i18n %}{% autoescape off %}{% blocktrans %}Initialization of your e-learning account at {{ organization }}{% endblocktrans %}{% endautoescape %}
\ No newline at end of file
+{% load i18n %}{% autoescape off %}{% blocktrans %}{{ organization }} : initialization of your e-learning account{% endblocktrans %}{% endautoescape %}
\ No newline at end of file
{% endblock %}
{% block document %}
- {% include "teleforma/inc/document_list.html" %}
+ {% with forloop.counter as type_counter %}
+ {% include "teleforma/inc/document_list.html" %}
+ {% endwith %}
{% endblock %}
</div>
<h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Documents"%}</h3>
</div>
+{% with course.document.all as docs %}
{% for doc_type in doc_types %}
-{% if course.document.all|from_course_type:type|from_doc_type:doc_type %}
+{% if docs|from_course_type:type|from_doc_type:doc_type and not type_counter > 1 %}
<span class="doc_type_title">{{ doc_type }}</span>
<table class="listing" width="100%">
<tbody>
- {% for document in course.document.all|from_course_type:type|from_doc_type:doc_type %}
+ {% for doc in docs|from_course_type:type|from_doc_type:doc_type %}
+ {% if doc.course_type.all|length > 1 and type_counter > 1 %}
+ {% else %}
<tr>
- <td {% if forloop.counter0 == 0 %}class="border-top"{% endif %} width="60%">{% if document.file %}<a href="{% url teleforma-document-view document.id %}" target="_blank" title="{% trans "View" %}"><img src="{{ STATIC_URL }}/teleforma/images/application-msword.png" style="vertical-align:middle" alt="" />{% endif %} {{ document.title }}{% if document.file %}</a>{% endif %}</td>
- <td {% if forloop.counter0 == 0 %}class="border-top"{% endif %} width="35%">{{ document.date_modified }}</td>
- <td {% if forloop.counter0 == 0 %}class="border-top"{% endif %} width="5%" align="center">{% if document.file %}<a href="{% url teleforma-document-download document.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="60%">{% if doc.file %}<a href="{% url teleforma-document-view document.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_modified }}</td>
+ <td {% if forloop.first %}class="border-top"{% endif %} width="5%" align="center">{% if doc.file %}<a href="{% url teleforma-document-download document.id %}"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></a>{% endif %}</td>
</tr>
+ {% endif %}
{% endfor %}
</tbody>
</table>
{% endif %}
{% endfor %}
+{% endwith %}
+
</div>
{% else %}
<div class="buttons">
{% if user.username != usr.username and user.is_staff %}
<a href="{% url teleforma-user-login usr.id %}" class="component_icon button icon_login">{% trans "Login as" %}</a>
-<a href="{% url telemeta-password-change %}" class="component_icon button icon_login">{% trans "Password reinitialization" %}</a>
+<a href="{% url telemeta-password-change usr.id %}" class="component_icon button icon_login">{% trans "Password reset" %}</a>
{% endif %}
</div>