From: yomguy Date: Thu, 17 Jan 2013 14:31:58 +0000 (+0100) Subject: add warnings, steps module, validation messages X-Git-Tag: 0.9-probarreau~129 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=b18a310a0bed7fedd4f144dc18e7601f6f93ef5b;p=teleforma.git add warnings, steps module, validation messages --- diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index 8e85556f..1951579d 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 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