From 4ac848bf93eea6ebd799a5564674ca8a8a38b86e Mon Sep 17 00:00:00 2001 From: yomguy Date: Tue, 19 Feb 2013 17:21:17 +0100 Subject: [PATCH] fix gender, some messages, bugfix non treaded answers --- teleforma/locale/fr/LC_MESSAGES/django.mo | Bin 18542 -> 18514 bytes teleforma/locale/fr/LC_MESSAGES/django.po | 45 +++++++++--------- .../templates/teleforma/answer_detail.html | 4 +- .../templates/teleforma/answer_form.html | 18 ++++--- .../teleforma/messages/answer_rejected.txt | 2 +- .../teleforma/messages/answer_validated.txt | 2 +- .../teleforma/messages/seminar_validated.txt | 4 +- .../teleforma/seminar_testimonial.html | 2 +- teleforma/templatetags/teleforma_tags.py | 2 +- teleforma/views/pro.py | 20 ++++---- 10 files changed, 55 insertions(+), 44 deletions(-) diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index b0a255c9180e83187dfbbc49a13fd0c3c5a3fc6d..f09bcd103286a908fead08cc3a2eebf09b53b0b2 100644 GIT binary patch delta 4501 zcmXZedvKK18OQOnxsqEAAqgY_x{?c|Q6NHqAb}v|u7Ob$rAnF!+pw5$$&E{Kwt!Yz zKx3C7IAy>}0}ZV(b#0JQNNwm8Oj`(5N3iG=0hIx2r5SBI$@Kfn`~3Ae=e*}U=Q+=N z*}dK3yU^lmc`_6i<=n1p=cYO5b`N(h5qmHR|Bi9^IS#>pVmwBVa4rRt@NvvS&8tUU z--xle1r_Ic8xPy~&r$pQVuTC1WE#I=AO=s^g;S_NXU!heh8Ix*KSKq$W7qpp3B-+b zZV;xR;$@=d<)GFV;J0uhD$cBtA#dU$1`-%pf(o!4b%Gk}*I_jMX6tXlyXbGT@i1zm zR@BC?q7HBvHSd_&iHds;HShfp4OQTh4Sa^$=%$T-iAtysm0;Yry@jcmN!IpL&d2!Lv=K?;d)d?KSZ76N2q{1P^H>!{Z~*WY`5_@ZTvLyD7n9& zHaKtBFQE>29kuQbDsGhDx%rO!pG2dafk#mp?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#;sFNp6@aHp8EzU#TFSPMUR3Q^FRp0+q zF7Ch|q6(?S{sD&dEy4jo7BKZkeXEmTJ`C;9~qLd7da&6ifM=%i*Xh%z~5Fx zo%U)_9^`6;8j%N759=Ht5AhT zP=&5St>0+wjdG!v>lEs3{v37U4phq$e&C-h6*ZrM3Y2T(AvP{S{Rg80wQmmUvs-}r z;aQ4meUr_vM#YJ4;6eq&P%p)=&Hc9E1S;`4)Fb*F70^xf=d;Xw)X58RFpffRbROjkZg+$HusF&|KRNS9q zGQNQ-d>5+V_b`S0?n5pV@E9u4pHK{hgr%s2m6(DvF&V2- z2^XOXuC?(hjB4YvT*y|`=eG@0a4#m|?@$5uqY7-d`D3VrCs7ADZ{y2Y#Q1B}4^jR! z|9c;ciZ>VavM!wFV*4|56JB?*)0yJ}-^8=B<^%#R7V2G<(A~xM^_~>C6}#5^X8{*q z-Dg=KAvqAc+V}3j8?lV+mss{@b}S(fh>zKY!gC8dR4U4s{HtO+%Gk+2tD8sWD0RJfU;f;|>) zs0%K)#bt%D%)#05?frLmj}0uyi7hGUYxaz9D`-tl967F}BwjrHUn%n=-r?O!8~UlY zJm}Si8y^d*GOww*Ze?A_8+LeiB)B5vkv>>U!kP5A5|WR{UR?nUO(nikJyOHwAjMQL(GhLcICH$Zgb{66u;}\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 -- 2.39.5