From b18a310a0bed7fedd4f144dc18e7601f6f93ef5b Mon Sep 17 00:00:00 2001 From: yomguy Date: Thu, 17 Jan 2013 15:31:58 +0100 Subject: [PATCH] add warnings, steps module, validation messages --- teleforma/locale/fr/LC_MESSAGES/django.mo | Bin 12370 -> 12344 bytes teleforma/locale/fr/LC_MESSAGES/django.po | 81 +++++++++++++----- .../templates/teleforma/answer_form.html | 23 ++++- .../templates/teleforma/evaluation_form.html | 6 ++ .../teleforma/messages/answer_validated.txt | 13 ++- .../teleforma/messages/seminar_validated.txt | 13 ++- .../templates/teleforma/seminar_detail.html | 2 +- .../teleforma/seminar_media_video.html | 3 +- teleforma/views/pro.py | 28 +++--- 9 files changed, 113 insertions(+), 56 deletions(-) diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index 8e85556fc21a90fe7391c439f67d692638dc5037..1951579d8376ea3cd9d8b9a9e10ccb61669eb878 100644 GIT binary patch delta 5341 zcmY+{3A|2q9>?)>uX`_Y#n`ThYqIZ4Op0k6T4^ecq=iIf>dF{}EDtftk}PewH4G+P zWL#6Uk|H&!n4(29*2t8mJ9#xtuW3G?dwwl*Ua#+c|NsAU&VM`Sc^-BS+%PcnQH`93 z5{@!*Dp_AKNiNMwl3vwpO_I^IlH?>DgPcmHU}c;cJ{;#4VRza~qJ9LcP%pzg{1$6s zUhTA>dRR3{GRbKa`g5WKdf|+?U@qoTUx0SBDB4#=`+9U@&tN{jf;qS|+IOQ9-XDH~ z448a@_LtQ0{tP!$@WKLg0)PbO5P%heD8J$oa zbb^KGeJwFlokBYb>c&KQ6G%%Oc6Svk!VNb!l~%WW}_WHh%RJ4+TT)ir&dRO zBf5hx6|n!Fcsow)#cb+_(E*O4=gZKQe2dA10-zIbdThWf+K(F744!kcs zhA!|+bZ0VI_0oarpdB?v2W*LcUOS;Hxd6SPAG&o#=mf^115QToyAK_34%**Bbil>v zb*qv0G+CFnXOis{9OxbNB|3^%wokI3FFjC*M{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2A@>lC_^SFX0Tb zkIb_+plt;lR_cE_tE zj{J(~S5IX$=}ShcLhxl?}NU?mx04O6faIc)W|m_yzo zQPy^c^LEh8*K_?iXlIR+@Oh$-S~~d+Q5izUk-@51c^E$;J;-j-i+oSYNJpZQ;p4`d z;!*M@*{DkRvjp#x>0}^zoWzq{vW>hzR9^9MU2!!TMD~*(iONiJg`6Xg5S0U@TlmQT zGY!s=z1H@Lp1;bUNh#?=eod~CXNk&oQjr`~g|gTu{P$JRyoh{`4(cN7

45XxIO$%lQQd6=5 zqk_Toz|@op+2b?P11W*hqU_Ql|L)SFV5p$Q`l$Z_W;FwS diff --git a/teleforma/locale/fr/LC_MESSAGES/django.po b/teleforma/locale/fr/LC_MESSAGES/django.po index 41f38da3..5d7a1203 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-01-17 10:04+0100\n" +"POT-Creation-Date: 2013-01-17 14:19+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Guillaume Pellerin \n" "Language-Team: LANGUAGE \n" @@ -22,7 +22,7 @@ msgid "user" msgstr "utilisateur" #: models/ae.py:47 models/core.py:137 models/core.py:350 models/core.py:410 -#: models/core.py:458 models/crfpa.py:64 models/crfpa.py:109 +#: models/core.py:460 models/crfpa.py:64 models/crfpa.py:109 msgid "period" msgstr "période" @@ -90,11 +90,11 @@ msgstr "adresse" msgid "Signature image" msgstr "" -#: models/core.py:124 models/core.py:155 models/core.py:456 +#: models/core.py:124 models/core.py:155 models/core.py:458 msgid "department" msgstr "département" -#: models/core.py:149 models/core.py:347 models/core.py:408 models/core.py:461 +#: models/core.py:149 models/core.py:347 models/core.py:408 models/core.py:463 msgid "course type" msgstr "type de matière" @@ -131,7 +131,7 @@ msgstr "magistral" msgid "types" msgstr "types" -#: models/core.py:179 models/core.py:344 models/core.py:406 models/core.py:460 +#: models/core.py:179 models/core.py:344 models/core.py:406 models/core.py:462 #: models/pro.py:65 templates/teleforma/inc/seminar_description.html:9 msgid "course" msgstr "matière" @@ -140,11 +140,11 @@ msgstr "matière" msgid "domain" msgstr "domaine" -#: models/core.py:217 models/core.py:462 models/pro.py:75 +#: models/core.py:217 models/core.py:464 models/pro.py:75 msgid "professor" msgstr "intervenant" -#: models/core.py:231 models/core.py:466 +#: models/core.py:231 models/core.py:468 msgid "room" msgstr "salle" @@ -172,7 +172,7 @@ msgstr "" msgid "streaming server" msgstr "serveur de diffusion" -#: models/core.py:259 models/core.py:348 models/core.py:404 models/core.py:551 +#: models/core.py:259 models/core.py:348 models/core.py:404 models/core.py:553 msgid "conference" msgstr "conférence" @@ -224,40 +224,40 @@ msgstr "annale" msgid "file" msgstr "fichier" -#: models/core.py:358 models/core.py:416 models/core.py:472 +#: models/core.py:358 models/core.py:416 models/core.py:474 msgid "readers" msgstr "" -#: models/core.py:454 models/pro.py:66 +#: models/core.py:456 models/pro.py:66 #: templates/teleforma/inc/seminar_description.html:7 msgid "sub title" msgstr "sous-titre" -#: models/core.py:455 +#: models/core.py:457 msgid "public id" msgstr "id public" -#: models/core.py:464 +#: models/core.py:466 msgid "session" msgstr "session" -#: models/core.py:468 +#: models/core.py:470 msgid "comment" msgstr "commentaire" -#: models/core.py:469 +#: models/core.py:471 msgid "begin date" msgstr "date de début" -#: models/core.py:470 +#: models/core.py:472 msgid "end date" msgstr "date de fin" -#: models/core.py:471 models/pro.py:69 +#: models/core.py:473 models/pro.py:69 msgid "price" msgstr "prix" -#: models/core.py:475 models/pro.py:77 +#: models/core.py:477 models/pro.py:77 #, fuzzy msgid "description documents" msgstr "description" @@ -455,7 +455,7 @@ msgid "Testimonial template" msgstr "Modèle d'attestation" #: models/pro.py:196 templates/teleforma/inc/testimonial_list.html:7 -#: templates/teleforma/inc/testimonial_step.html:7 views/pro.py:484 +#: templates/teleforma/inc/testimonial_step.html:7 views/pro.py:492 msgid "Testimonial" msgstr "Attestation" @@ -708,7 +708,7 @@ msgstr "" msgid "Reply" msgstr "" -#: templates/postman/seminar_validated.txt:3 +#: templates/postman/seminar_validated.txt:2 #, fuzzy msgid "" "Congratulations!\n" @@ -1273,6 +1273,37 @@ msgstr "durée" msgid "hours" msgstr "heures" +#: templates/teleforma/messages/answer_validated.txt:2 +#, fuzzy +msgid "" +"Congratulations!\n" +"\n" +"Your seminar has been completed and validated. \n" +"You can now download the training testimonial following this link:\n" +msgstr "" +"Félicitations!\n" +"\n" +"Votre dernière consultation a été validée.\n" +"Vous pouvez accéder à la prochaine étape de votre séminaire en suivant ce " +"lien :\n" + +#: templates/teleforma/messages/seminar_validated.txt:2 +#, fuzzy, python-format +msgid "" +"Congratulations!\n" +"\n" +"Your answer has been validated.\n" +"You can continue to the next step of your seminar following this link:\n" +" \n" +"http://%(site.name)s%(seminar_url)s\n" +"\n" +msgstr "" +"Félicitations!\n" +"\n" +"Votre dernière consultation a été validée.\n" +"Vous pouvez accéder à la prochaine étape de votre séminaire en suivant ce " +"lien :\n" + #: templates/telemeta/base.html:96 msgid "Desk" msgstr "Bureau" @@ -1554,15 +1585,19 @@ msgstr "Vous avez enregistré votre consultation avec succès" msgid "You have successfully submitted your answer" msgstr "Vous avez soumis votre consultation avec succès" -#: views/pro.py:262 -msgid "Your answer has been validated" -msgstr "Votre consultation a été validée" +#: views/pro.py:270 +#, fuzzy +msgid "Answer validated" +msgstr "validé" -#: views/pro.py:357 +#: views/pro.py:365 #, fuzzy msgid "You have successfully submitted your evaluation" msgstr "Vous avez soumis votre évaluation avec succès" +#~ msgid "Your answer has been validated" +#~ msgstr "Votre consultation a été validée" + #~ msgid "Index" #~ msgstr "Index" diff --git a/teleforma/templates/teleforma/answer_form.html b/teleforma/templates/teleforma/answer_form.html index b89fd5fb..4daacea2 100644 --- a/teleforma/templates/teleforma/answer_form.html +++ b/teleforma/templates/teleforma/answer_form.html @@ -22,9 +22,10 @@ $(document).ready(function(){ }); $(document).ready(function(){ - var b = $('#submit_button'); + var b1 = $('#submit_button'); var c = $('#counter') - b.unbind('click').click(function() { + b1.unbind('click').click(function() { + $(window).unbind('beforeunload'); if (c.hasClass('deceed')){ new Messi(gettext('You must reach the required number of characters.'), {buttons: [{id: 0, label: gettext('OK'), val: 'X'}], modal: true}); } @@ -33,8 +34,23 @@ $(document).ready(function(){ $('#_AnswerForm').submit(); } }); + + var b2 = $('#save_button'); + b2.unbind('click').click(function() { + $(window).unbind('beforeunload'); + $('#_AnswerForm').submit(); }); + {% if status != 3 %} + $(window).bind('beforeunload', function(){ + return '{% trans "You have NOT save your work!" %}'; + }); + {% endif %} + +}); + +$('#seminars').css({'max-height': '200px'}); + {% endblock extra_javascript %} @@ -68,8 +84,7 @@ $(document).ready(function(){ {% if status != 3 %}
-{% trans "Save" %} +{% trans "Save" %} {% trans "Submit it" %} {% endif %} diff --git a/teleforma/templates/teleforma/evaluation_form.html b/teleforma/templates/teleforma/evaluation_form.html index 112d0897..9c8ab4ca 100644 --- a/teleforma/templates/teleforma/evaluation_form.html +++ b/teleforma/templates/teleforma/evaluation_form.html @@ -14,6 +14,11 @@ + {% endblock course_content %} @@ -25,3 +30,4 @@ {% endblock index %} + diff --git a/teleforma/templates/teleforma/messages/answer_validated.txt b/teleforma/templates/teleforma/messages/answer_validated.txt index da8ce631..55e24566 100644 --- a/teleforma/templates/teleforma/messages/answer_validated.txt +++ b/teleforma/templates/teleforma/messages/answer_validated.txt @@ -1,10 +1,9 @@ {% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %} -{% blocktrans %} -Congratulations! +{% blocktrans %}Congratulations! -Your answer have been validated. -You can now download the training testimonial following this link: - -http://{{ site.name }}{{ testimonial_url }} +Your answer has been validated. +You can go to the next step of your seminar following this link: +{% endblocktrans %} +http://{{ site.name }}{{ url }} -{% endblocktrans } \ No newline at end of file +{% organization %} \ No newline at end of file diff --git a/teleforma/templates/teleforma/messages/seminar_validated.txt b/teleforma/templates/teleforma/messages/seminar_validated.txt index 5617cf6f..3d3e65d2 100644 --- a/teleforma/templates/teleforma/messages/seminar_validated.txt +++ b/teleforma/templates/teleforma/messages/seminar_validated.txt @@ -1,10 +1,9 @@ {% load i18n %}{% load telemeta_utils %}{% load teleforma_tags %} -{% blocktrans %} -Congratulations! +{% blocktrans %}Congratulations! -Your answer has been validated. -You can continue to the next step of your seminar following this link: - -http://{{ site.name }}{{ seminar_url }} +Your seminar has been validated. +You can now download the training testimonial following this link: +{% endblocktrans %} +http://{{ site.name }}{{ url }} -{% endblocktrans } \ No newline at end of file +{% organization %} \ No newline at end of file diff --git a/teleforma/templates/teleforma/seminar_detail.html b/teleforma/templates/teleforma/seminar_detail.html index e7b8b3f7..b6bf2e58 100644 --- a/teleforma/templates/teleforma/seminar_detail.html +++ b/teleforma/templates/teleforma/seminar_detail.html @@ -129,7 +129,7 @@ $(function () { {% endwith %} {% endif %} - {% if seminar_validated %} + {% if seminar_validated and seminar_progress == 100 %}

{% trans "Step" %} 7 : {% trans "download your testimonial" %}

diff --git a/teleforma/templates/teleforma/seminar_media_video.html b/teleforma/templates/teleforma/seminar_media_video.html index 343310ea..676c78f5 100644 --- a/teleforma/templates/teleforma/seminar_media_video.html +++ b/teleforma/templates/teleforma/seminar_media_video.html @@ -45,8 +45,7 @@ $(window).ready(function(){ } ); - var module = $('#seminars'); - module.css({'max-height': '200px'}); + $('#seminars').css({'max-height': '200px'}); }); diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 3ef141d7..9896942b 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -259,20 +259,26 @@ class AnswersView(ListView): user = answer.user sender = request.user seminar = answer.question.seminar + site = Site.objects.get_current() + if seminar_validated(user, seminar): testimonial = Testimonial(user=user, seminar=seminar) testimonial.save() - site = Site.objects.get_current() - seminar_url = reverse('teleforma-seminar-detail', kwargs={'pk':seminar.id}) - ctx_dict = {'site': site, 'seminar_url': seminar_url,} + url = reverse('teleforma-seminar-testimonial-download', kwargs={'pk':seminar.id}) + '?format=pdf' + ctx_dict = {'site': site, 'url': url,} + subject = _('Seminar validated') + ' : ' + seminar.title text = render_to_string('teleforma/messages/seminar_validated.txt', ctx_dict) - mess = Message(sender=sender, recipient=user, - subject=_('Answer validated') + ' : ' + seminar.title, - body=text) - mess.moderation_status = 'a' - mess.save() - notify_user(mess, 'acceptance') - + else: + url = reverse('teleforma-seminar-detail', kwargs={'pk':seminar.id}) + ctx_dict = {'site': site, 'url': url,} + text = render_to_string('teleforma/messages/answer_validated.txt', ctx_dict) + subject = _('Answer validated') + ' : ' + seminar.title + + mess = Message(sender=sender, recipient=user, subject=subject, body=text) + mess.moderation_status = 'a' + mess.save() + notify_user(mess, 'acceptance') + @jsonrpc_method('teleforma.reject_answer') def reject(request, id): answer = Answer.objects.get(id=id) @@ -462,8 +468,6 @@ class PDFTemplateResponseMixin(TemplateResponseMixin): context, **response_kwargs) - - class TestimonialView(PDFTemplateResponseMixin, SeminarView): model = Seminar -- 2.39.5