From: yomguy Date: Tue, 19 Feb 2013 16:21:17 +0000 (+0100) Subject: fix gender, some messages, bugfix non treaded answers X-Git-Tag: 0.9-probarreau~17 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4ac848bf93eea6ebd799a5564674ca8a8a38b86e;p=teleforma.git fix gender, some messages, bugfix non treaded answers --- diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index b0a255c9..f09bcd10 100644 Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ diff --git a/teleforma/locale/fr/LC_MESSAGES/django.po b/teleforma/locale/fr/LC_MESSAGES/django.po index 44546eac..758e2cc7 100644 --- a/teleforma/locale/fr/LC_MESSAGES/django.po +++ b/teleforma/locale/fr/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-19 10:22+0100\n" +"POT-Creation-Date: 2013-02-19 16:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Guillaume Pellerin \n" "Language-Team: LANGUAGE \n" @@ -404,7 +404,7 @@ msgstr "documents corrigés" msgid "form" msgstr "formulaire" -#: models/pro.py:130 templates/teleforma/answer_form.html:104 +#: models/pro.py:130 templates/teleforma/answer_form.html:110 #: templates/teleforma/seminar_detail.html:158 #: templates/teleforma/testimonials.html:58 #: templates/teleforma/inc/answer_list.html:14 @@ -453,7 +453,7 @@ msgid "date validated" msgstr "date de validation" #: models/pro.py:185 templates/teleforma/answer_detail.html:43 -#: templates/teleforma/answer_form.html:107 +#: templates/teleforma/answer_form.html:113 msgid "Answer" msgstr "Réponse à la consultation" @@ -780,7 +780,7 @@ msgstr "Rejeté" msgid ":" msgstr "" -#: templates/postman/view.html:36 +#: templates/postman/view.html:36 templates/teleforma/answer_form.html:72 #: templates/teleforma/seminar_media_audio.html:8 #: templates/teleforma/seminar_media_video.html:68 msgid "Back" @@ -808,7 +808,7 @@ msgstr "Vous n'avez PAS enregistré votre consultation" msgid "My steps" msgstr "Mes étapes" -#: templates/teleforma/answer_form.html:74 +#: templates/teleforma/answer_form.html:80 #: templates/teleforma/evaluation_form.html:10 #: templates/teleforma/seminar_detail.html:77 #: templates/teleforma/seminar_detail.html:86 @@ -824,35 +824,35 @@ msgstr "Mes étapes" msgid "Step" msgstr "Étape" -#: templates/teleforma/answer_form.html:74 +#: templates/teleforma/answer_form.html:80 #: templates/teleforma/seminar_detail.html:105 msgid "answer to this question" msgstr "réaliser cette consultation fictive" -#: templates/teleforma/answer_form.html:74 +#: templates/teleforma/answer_form.html:80 msgid "characters" msgstr "caractères" -#: templates/teleforma/answer_form.html:74 +#: templates/teleforma/answer_form.html:80 msgid "minimum" msgstr "minimum" -#: templates/teleforma/answer_form.html:88 +#: templates/teleforma/answer_form.html:94 msgid "Save" msgstr "" -#: templates/teleforma/answer_form.html:89 +#: templates/teleforma/answer_form.html:95 msgid "Submit it" msgstr "Soumettre" # #: templates/teleforma/seminar_detail.html:152 -#: templates/teleforma/answer_form.html:97 +#: templates/teleforma/answer_form.html:103 #: templates/teleforma/seminar_detail.html:152 #: templates/teleforma/seminars.html:134 msgid "Progressions" msgstr "Progressions" -#: templates/teleforma/answer_form.html:101 +#: templates/teleforma/answer_form.html:107 #: templates/teleforma/seminar_detail.html:155 #: templates/teleforma/seminars.html:137 msgid "General" @@ -1390,9 +1390,8 @@ msgid "" "\n" "You have then achieved the step 4 of your training.\n" "\n" -"Now read the corrected document of all questions (step 5) and evaluate the " -"training (step 6) in order to obtain your testimonial (step 7) following " -"this link:\n" +"Now read the corrected document of each questions (step 5) following this " +"link:\n" "\n" "http://%(domain)s%(path)s\n" "\n" @@ -1410,8 +1409,7 @@ msgstr "" "Vous avez achevé l’étape 4 de votre formation.\n" "\n" "Consultez dès à présent le corrigé-type des consultations fictives (étape 5) " -"et évaluez la formation suivie (étape 6) afin d’obtenir votre attestation " -"(étape 7) en suivant ce lien :\n" +"en suivant ce lien :\n" "\n" "http://%(domain)s%(path)s\n" "\n" @@ -1711,18 +1709,21 @@ msgstr "" "télécharger votre attestation de formation ci-dessous." #: views/pro.py:184 -msgid "You have successfully saved your answer" -msgstr "Vous avez enregistré votre consultation avec succès" +msgid "You have successfully saved your answer." +msgstr "Vous avez enregistré votre consultation avec succès." #: views/pro.py:186 -msgid "You have successfully submitted your answer" -msgstr "Vous avez soumis votre consultation avec succès" +msgid "You have successfully submitted your answer." +msgstr "" +"Vous avez soumis votre consultation avec succès. Vous recevrez un message " +"dès que celle-ci aura été validée par notre équipe pédagogique (48 heures " +"ouvrées maximum)." #: views/pro.py:190 msgid "Your submission has not been saved correctly. Please try again." msgstr "" "Votre consultation n'a pas été enregistrée correctement, veuillez réessayer " -"SVP." +"s'il vous plaît." #: views/pro.py:301 views/pro.py:358 views/pro.py:402 msgid "Subtitle" diff --git a/teleforma/templates/teleforma/answer_detail.html b/teleforma/templates/teleforma/answer_detail.html index f908717c..ed9b04da 100644 --- a/teleforma/templates/teleforma/answer_detail.html +++ b/teleforma/templates/teleforma/answer_detail.html @@ -40,7 +40,7 @@ $('#reject').unbind('click').click(function() {
-

{% trans "Answer" %}

+

{% trans "Answer" %}{% if answer.question.rank %}n° {{ answer.question.rank }}{% endif %}

{{ answer.answer|safe }} @@ -50,7 +50,7 @@ $('#reject').unbind('click').click(function() {
{% if user.is_staff %} -{% trans " validate" %} +{% trans " validate" %} {% trans " reject" %} {% endif %} diff --git a/teleforma/templates/teleforma/answer_form.html b/teleforma/templates/teleforma/answer_form.html index eee7e8f3..86ce17aa 100644 --- a/teleforma/templates/teleforma/answer_form.html +++ b/teleforma/templates/teleforma/answer_form.html @@ -15,10 +15,10 @@ $(document).ready(function(){ }); {% endif %} -$(document).ready(function(){ +$(document).ready(function(){ //default usage $("#id_answer").charCount({ - necessary: {{question.min_nchar}}, + necessary: {{question.min_nchar}}, counterText: gettext('Characters')+' : ', }); }); @@ -32,11 +32,11 @@ $(document).ready(function(){ new Messi(gettext('You must reach the required number of characters.'), {buttons: [{id: 0, label: gettext('OK'), val: 'X'}], modal: true}); } if (c.hasClass('exceed')){ - $('#id_status').val("3"); - $('#_AnswerForm').submit(); + $('#id_status').val("3"); + $('#_AnswerForm').submit(); } }); - + var b2 = $('#save_button'); b2.unbind('click').click(function() { $(window).unbind('beforeunload'); @@ -67,6 +67,12 @@ $(document).ready(function(){
{% endblock submodules %} +{% block module-action %} + +{% endblock module-action %} + {% block course_content %}
@@ -77,7 +83,7 @@ $(document).ready(function(){ {{ question.question|safe }}
- +
{% csrf_token %} {{ form }} diff --git a/teleforma/templates/teleforma/messages/answer_rejected.txt b/teleforma/templates/teleforma/messages/answer_rejected.txt index 0895a3e7..330106d2 100644 --- a/teleforma/templates/teleforma/messages/answer_rejected.txt +++ b/teleforma/templates/teleforma/messages/answer_rejected.txt @@ -1,4 +1,4 @@ -{% load i18n %}{% blocktrans %}{{ gender }} {{ first_name }} {{ last_name }}, +{% load i18n %}{% blocktrans %}{{ gender }} {{ last_name }}, We are sorry we cannot validate your answer n°{{ rank }} of the e-learning seminar "{{ title }}". diff --git a/teleforma/templates/teleforma/messages/answer_validated.txt b/teleforma/templates/teleforma/messages/answer_validated.txt index 13609ac6..4af2424d 100644 --- a/teleforma/templates/teleforma/messages/answer_validated.txt +++ b/teleforma/templates/teleforma/messages/answer_validated.txt @@ -1,4 +1,4 @@ -{% load i18n %}{% blocktrans %}{{ gender }} {{ first_name }} {{ last_name }}, +{% load i18n %}{% blocktrans %}{{ gender }} {{ last_name }}, Your answer to the question n°{{ rank }} of the e-learning seminar "{{ title }}" has been validated. diff --git a/teleforma/templates/teleforma/messages/seminar_validated.txt b/teleforma/templates/teleforma/messages/seminar_validated.txt index 36102965..a64071fd 100644 --- a/teleforma/templates/teleforma/messages/seminar_validated.txt +++ b/teleforma/templates/teleforma/messages/seminar_validated.txt @@ -1,10 +1,10 @@ -{% load i18n %}{% blocktrans %}{{ gender }} {{ first_name }} {{ last_name }}, +{% load i18n %}{% blocktrans %}{{ gender }} {{ last_name }}, Your answer to the question n°{{ rank }} of the e-learning seminar "{{ title }}" has been validated. You have then achieved the step 4 of your training. -Now read the corrected document of all questions (step 5) and evaluate the training (step 6) in order to obtain your testimonial (step 7) following this link: +Now read the corrected document of each questions (step 5) following this link: http://{{ domain }}{{ path }} diff --git a/teleforma/templates/teleforma/seminar_testimonial.html b/teleforma/templates/teleforma/seminar_testimonial.html index 97f0515e..b1d4aa95 100644 --- a/teleforma/templates/teleforma/seminar_testimonial.html +++ b/teleforma/templates/teleforma/seminar_testimonial.html @@ -34,7 +34,7 @@ {% trans "Last name" %} : {{ user.last_name|upper }} {% trans "First name" %} : {{ user.first_name|upper }} {% trans "Address" %} : {{ user.auditor.all.0.address }} {{ user.auditor.all.0.postal_code }} {{ user.auditor.all.0.city }} - {% trans "Sujet" %} : {{ seminar.title }} {% if seminar.rank %} n°{{seminar.rank}}{% endif %} + {% trans "Sujet" %} : {{ seminar.title }} {% trans "Course" %} : {{ seminar.course }} {% trans "Training type" %} : E-learning {% trans "Duration" %} : {{ seminar.duration|hours }} {% trans "hours" %} diff --git a/teleforma/templatetags/teleforma_tags.py b/teleforma/templatetags/teleforma_tags.py index 0ce825e9..e51f2ad2 100644 --- a/teleforma/templatetags/teleforma_tags.py +++ b/teleforma/templatetags/teleforma_tags.py @@ -302,7 +302,7 @@ def fancy_duration(duration): @register.simple_tag def untreated_answer_count(): - answers = Answer.objects.filter(treated=False) + answers = Answer.objects.filter(treated=False, status=3) if answers: return ' (' + str(len(answers)) + ')' else: diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 566b2773..d025ee1f 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -181,9 +181,9 @@ class AnswerView(SeminarAccessMixin, FormView): answer.question = self.question answer.save() if answer.status <= 2: - messages.info(self.request, _("You have successfully saved your answer")) + messages.info(self.request, _("You have successfully saved your answer.")) elif answer.status == 3: - messages.info(self.request, _("You have successfully submitted your answer")) + messages.info(self.request, _("You have successfully submitted your answer.")) return super(AnswerView, self).form_valid(form) def form_invalid(self, form): @@ -304,7 +304,7 @@ class AnswersView(ListView): auditor = user.auditor.all() if auditor: - gender = unicode(_(auditor[0].gender)) + gender = auditor[0].get_gender_display() else: gender = '' context['gender'] = gender @@ -361,9 +361,10 @@ class AnswersView(ListView): auditor = user.auditor.all() if auditor: - gender = unicode(_(auditor[0].gender)) + gender = auditor[0].get_gender_display() else: gender = '' + context['gender'] = gender context['first_name'] = user.first_name context['last_name'] = user.last_name @@ -398,17 +399,20 @@ class AnswerDetailViewTest(DetailView): sender = self.request.user site = Site.objects.get_current() path= reverse('teleforma-question-answer', kwargs={'id': seminar.id, 'pk': answer.question.id}) + organization = seminar.course.department.name + if answer.question.seminar.sub_title: title = unicode(_('Subtitle')) + ' : ' + seminar.sub_title else: title = unicode(_('Course')) + ' : ' + seminar.course.title - organization = seminar.course.department.name + auditor = user.auditor.all() if auditor: - context['gender'] = auditor[0].gender + context['gender'] = auditor[0].get_gender_display() else: - context['gender'] = user.first_name - context['lastname'] = user.last_name + context['gender'] = '' + + context['last_name'] = user.last_name context['rank'] = answer.question.rank context['domain'] = site.name context['path'] = path