From: yomguy Date: Thu, 3 Jan 2013 00:59:28 +0000 (+0100) Subject: fix progress workflow & messages X-Git-Tag: 0.9-probarreau~171 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9afb4bf98dc2dfb89ae9106f95fc887ea48fc503;p=teleforma.git fix progress workflow & messages --- diff --git a/teleforma/context_processors.py b/teleforma/context_processors.py index b632c0f1..d54680de 100644 --- a/teleforma/context_processors.py +++ b/teleforma/context_processors.py @@ -75,19 +75,6 @@ def seminar_validated(user, seminar): return not False in validated return False -def seminar_terminated(user, seminar): - validated = [] - questions = seminar.question.all() - if questions: - for question in questions: - answers = Answer.objects.filter(question=question, user=user, status=3) - if answers: - validated.append(True) - else: - validated.append(False) - return not False in validated - return False - def all_seminars(request, progress_order=False): seminars = [] diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index 6a832fc1..c68b1c8a 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 081bceae..e3d23636 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-02 23:54+0100\n" +"POT-Creation-Date: 2013-01-03 01:50+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Guillaume Pellerin \n" "Language-Team: LANGUAGE \n" @@ -385,8 +385,8 @@ msgid "form" msgstr "formulaire" #: models/pro.py:150 templates/teleforma/answer_form.html:77 -#: templates/teleforma/seminar_detail.html:159 -#: templates/teleforma/seminar_media_audio.html:56 +#: templates/teleforma/seminar_detail.html:158 +#: templates/teleforma/seminar_media_audio.html:70 #: templates/teleforma/seminar_media_video.html:104 #: templates/teleforma/testimonials.html:64 #: templates/teleforma/inc/answer_list.html:21 @@ -449,7 +449,7 @@ msgid "Testimonial template" msgstr "Modèle d'attestation" #: models/pro.py:232 templates/teleforma/inc/testimonial_list.html:7 -#: views/pro.py:484 +#: templates/teleforma/inc/testimonial_step.html:7 views/pro.py:487 msgid "Testimonial" msgstr "Attestation" @@ -747,8 +747,25 @@ msgid " reject" msgstr " rejeter" #: templates/teleforma/answer_form.html:46 -msgid "Answer to the following question" -msgstr "Réalisez la consultation fictive suivante" +#: templates/teleforma/evaluation_form.html:10 +#: templates/teleforma/seminar_detail.html:77 +#: templates/teleforma/seminar_detail.html:86 +#: templates/teleforma/seminar_detail.html:96 +#: templates/teleforma/seminar_detail.html:105 +#: templates/teleforma/seminar_detail.html:116 +#: templates/teleforma/seminar_detail.html:125 +#: templates/teleforma/seminar_detail.html:135 +#: templates/teleforma/inc/steps.html:6 templates/teleforma/inc/steps.html:13 +#: templates/teleforma/inc/steps.html:21 templates/teleforma/inc/steps.html:28 +#: templates/teleforma/inc/steps.html:37 templates/teleforma/inc/steps.html:44 +#: templates/teleforma/inc/steps.html:52 +msgid "Step" +msgstr "Étape" + +#: templates/teleforma/answer_form.html:46 +#: templates/teleforma/seminar_detail.html:105 +msgid "answer to this question" +msgstr "réaliser cette consultation fictive" #: templates/teleforma/answer_form.html:46 msgid "characters" @@ -767,18 +784,21 @@ msgid "Submit it" msgstr "Soumettre" #: templates/teleforma/answer_form.html:70 -#: templates/teleforma/seminar_detail.html:153 +#: templates/teleforma/seminar_detail.html:152 #: templates/teleforma/seminars.html:130 msgid "Progressions" msgstr "Progressions" #: templates/teleforma/answer_form.html:74 -#: templates/teleforma/seminar_detail.html:156 +#: templates/teleforma/seminar_detail.html:155 #: templates/teleforma/seminars.html:133 msgid "General" msgstr "Général" #: templates/teleforma/answer_form.html:94 +#: templates/teleforma/evaluation_form.html:22 +#: templates/teleforma/seminar_media_audio.html:102 +#: templates/teleforma/seminar_media_video.html:136 msgid "Steps" msgstr "Étapes" @@ -841,7 +861,7 @@ msgstr "Description" #: templates/teleforma/course.html:19 templates/teleforma/course.html.py:35 #: templates/teleforma/course.html:52 #: templates/teleforma/course_media.html:142 -#: templates/teleforma/seminar_media_audio.html:70 +#: templates/teleforma/seminar_media_audio.html:84 #: templates/teleforma/seminar_media_video.html:118 #: templates/telemeta/profile_detail.html:84 msgid "Date added" @@ -870,7 +890,7 @@ msgstr "Session" #: templates/teleforma/course_conference.html:72 #: templates/teleforma/course_conference_audio.html:67 #: templates/teleforma/course_media.html:133 -#: templates/teleforma/seminar_media_audio.html:60 +#: templates/teleforma/seminar_media_audio.html:74 #: templates/teleforma/seminar_media_video.html:108 #: templates/teleforma/inc/conference_list.html:27 #: templates/teleforma/inc/media_list.html:39 @@ -981,13 +1001,13 @@ msgid "Download" msgstr "Télécharger" #: templates/teleforma/course_media.html:141 -#: templates/teleforma/seminar_media_audio.html:66 +#: templates/teleforma/seminar_media_audio.html:80 #: templates/teleforma/seminar_media_video.html:114 msgid "Mime type" msgstr "Type mime" #: templates/teleforma/course_media.html:143 -#: templates/teleforma/seminar_media_audio.html:71 +#: templates/teleforma/seminar_media_audio.html:85 #: templates/teleforma/seminar_media_video.html:119 msgid "Date modified" msgstr "Date de modification" @@ -1013,75 +1033,58 @@ msgid "Status" msgstr "Status" #: templates/teleforma/evaluation_form.html:10 -msgid "Step 6 : evaluate the seminar" -msgstr "Étape 6 : évaluer ce séminaire" +#: templates/teleforma/seminar_detail.html:125 +msgid "evaluate the seminar" +msgstr "évaluer ce séminaire" #: templates/teleforma/help.html:11 templates/telemeta/base.html:115 #: templates/telemeta/base.html.py:127 msgid "Help" msgstr "Aide" -#: templates/teleforma/seminar_detail.html:61 +#: templates/teleforma/seminar_detail.html:60 msgid "Informations" msgstr "Informations" -#: templates/teleforma/seminar_detail.html:78 -#: templates/teleforma/seminar_detail.html:87 -#: templates/teleforma/seminar_detail.html:97 -#: templates/teleforma/seminar_detail.html:106 -#: templates/teleforma/seminar_detail.html:117 -#: templates/teleforma/seminar_detail.html:126 -#: templates/teleforma/seminar_detail.html:136 -msgid "Step" -msgstr "Étape" - -#: templates/teleforma/seminar_detail.html:78 -#: templates/teleforma/seminar_detail.html:97 -#: templates/teleforma/seminar_detail.html:117 +#: templates/teleforma/seminar_detail.html:77 +#: templates/teleforma/seminar_detail.html:96 +#: templates/teleforma/seminar_detail.html:116 msgid "read these documents" msgstr "lire ces documents" -#: templates/teleforma/seminar_detail.html:78 -#: templates/teleforma/seminar_detail.html:97 -#: templates/teleforma/seminar_detail.html:117 +#: templates/teleforma/seminar_detail.html:77 +#: templates/teleforma/seminar_detail.html:96 +#: templates/teleforma/seminar_detail.html:116 msgid "read this document" msgstr "lire ce document" -#: templates/teleforma/seminar_detail.html:87 +#: templates/teleforma/seminar_detail.html:86 msgid "view these conferences" msgstr "visionner ces conférences" -#: templates/teleforma/seminar_detail.html:87 +#: templates/teleforma/seminar_detail.html:86 msgid "view this conference" msgstr "visionner cette conférence" -#: templates/teleforma/seminar_detail.html:106 +#: templates/teleforma/seminar_detail.html:105 msgid "answer to these questions" msgstr "réaliser ces consultations fictives" -#: templates/teleforma/seminar_detail.html:106 -msgid "answer to this question" -msgstr "réaliser cette consultation fictive" - -#: templates/teleforma/seminar_detail.html:126 -msgid "evaluate the seminar" -msgstr "évaluer ce séminaire" - -#: templates/teleforma/seminar_detail.html:136 +#: templates/teleforma/seminar_detail.html:135 msgid "download your testimonial" msgstr "obtenez votre attestation" -#: templates/teleforma/seminar_detail.html:171 +#: templates/teleforma/seminar_detail.html:170 msgid "Index" msgstr "Index" -#: templates/teleforma/seminar_media_audio.html:60 +#: templates/teleforma/seminar_media_audio.html:74 #: templates/teleforma/seminar_media_video.html:108 #: templates/teleforma/inc/media_package_list.html:34 msgid "Professors" msgstr "Professeurs" -#: templates/teleforma/seminar_media_audio.html:72 +#: templates/teleforma/seminar_media_audio.html:86 #: templates/teleforma/seminar_media_video.html:120 msgid "Media package ID" msgstr "ID Media pakage" @@ -1167,6 +1170,7 @@ msgstr "Conférences en direct" #: templates/teleforma/inc/conference_list.html:18 #: templates/teleforma/inc/document_list.html:20 #: templates/teleforma/inc/document_simple_list.html:8 +#: templates/teleforma/inc/document_step.html:8 msgid "View" msgstr "Voir" @@ -1175,6 +1179,8 @@ msgstr "Voir" #: templates/teleforma/inc/media_list.html:29 #: templates/teleforma/inc/media_package_list.html:18 #: templates/teleforma/inc/media_package_list.html:24 +#: templates/teleforma/inc/media_step.html:18 +#: templates/teleforma/inc/media_step.html:24 msgid "Click here" msgstr "Cliquez ici" @@ -1192,6 +1198,7 @@ msgstr "Conférences en différé" #: templates/teleforma/inc/media_list.html:17 #: templates/teleforma/inc/media_package_list.html:12 +#: templates/teleforma/inc/media_step.html:12 msgid "Play" msgstr "Lire" @@ -1208,14 +1215,17 @@ msgid "validated on" msgstr "validée le" #: templates/teleforma/inc/question_list.html:21 +#: templates/teleforma/inc/question_step.html:12 msgid "Waiting for validation" msgstr "Attend une validation" #: templates/teleforma/inc/question_list.html:23 +#: templates/teleforma/inc/question_step.html:14 msgid "Saved" msgstr "enregistrée le" #: templates/teleforma/inc/question_list.html:25 +#: templates/teleforma/inc/question_step.html:16 msgid "Validated" msgstr "validé" @@ -1482,7 +1492,7 @@ msgstr "" "Merci de vous connecter ou bien contactez l'administateur du site pour " "obtenir un accès privé." -#: views/pro.py:154 +#: views/pro.py:115 msgid "" "You have successfully terminated your e-learning seminar. A training " "testimonial will be available as soon as the pedagogical team validate all " @@ -1492,18 +1502,32 @@ msgstr "" "formation vous sera délivrée dès que vos réponses aux consultations fictives " "auront été validées par notre équipe pédagogique (48h maximum)." -#: views/pro.py:156 +#: views/pro.py:117 +msgid "" +"All your answers have been validated! You can now download the training " +"testimonial below." +msgstr "" +"Toutes vos consulations fictives ont été validées ! Vous pouvez désormais " +"télécharger l'attestion de formation ci-dessous." + +#: views/pro.py:159 msgid "You have successfully saved your answer" msgstr "Vous avez enregistré votre reponse avec succès" -#: views/pro.py:158 +#: views/pro.py:161 msgid "You have successfully submitted your answer" msgstr "Vous avez soumis votre reponse avec succès" -#: views/pro.py:356 +#: views/pro.py:359 msgid "You have successfully sumitted your evaluation" msgstr "Vous avez soumis votre évaluation avec succès" +#~ msgid "Answer to the following question" +#~ msgstr "Réalisez la consultation fictive suivante" + +#~ msgid "Step 6 : evaluate the seminar" +#~ msgstr "Étape 6 : évaluer ce séminaire" + #~ msgid "Step 4 : answer to this question" #~ msgstr "Étape 4 : réaliser cette consultation fictive" diff --git a/teleforma/static/teleforma/css/teleforma.css b/teleforma/static/teleforma/css/teleforma.css index db23fcb6..bd3e085f 100644 --- a/teleforma/static/teleforma/css/teleforma.css +++ b/teleforma/static/teleforma/css/teleforma.css @@ -1691,9 +1691,10 @@ input,textarea{ } .info { + margin-top: 0.3em; color: white; - padding: 0.3em 0.3em 0.5em 0.5em; - background-color: green; + padding: 0.3em 0.3em 0.5em 0.8em; + background-color: #008000; -moz-border-radius: 8px 0px 8px 8px; -webkit-border-radius: 8px 0px 8px 8px; border-radius: 8px 0px 8px 8px; @@ -1702,8 +1703,18 @@ input,textarea{ .success { margin-top: 1em; color: white; - padding: 0.3em 0.3em 0.5em 0.5em; - background-color: green; + padding: 0.3em 0.3em 0.5em 0.8em; + background-color: #008000; + -moz-border-radius: 8px 0px 8px 8px; + -webkit-border-radius: 8px 0px 8px 8px; + border-radius: 8px 0px 8px 8px; +} + +.warning { + margin-top: 0.3em; + color: white; + padding: 0.3em 0.3em 0.5em 0.8em; + background-color: #e65911; -moz-border-radius: 8px 0px 8px 8px; -webkit-border-radius: 8px 0px 8px 8px; border-radius: 8px 0px 8px 8px; diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 128e30b3..f7ec7133 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -107,11 +107,16 @@ class SeminarView(DetailView): def get_context_data(self, **kwargs): context = super(SeminarView, self).get_context_data(**kwargs) seminar = self.get_object() - context['seminar_progress'] = seminar_progress(self.request.user, seminar) - context['seminar_validated'] = seminar_validated(self.request.user, seminar) + progress = seminar_progress(self.request.user, seminar) + validated = seminar_validated(self.request.user, seminar) + context['seminar_progress'] = progress + context['seminar_validated'] = validated + if progress == 100 and not validated: + messages.warning(self.request, _("You have successfully terminated your e-learning seminar. A training testimonial will be available as soon as the pedagogical team validate all your answers (48h maximum).")) + elif validated: + messages.info(self.request, _("All your answers have been validated! You can now download the training testimonial below.")) return context - class SeminarsView(ListView): model = Seminar @@ -150,9 +155,7 @@ class AnswerView(FormView): answer.user = self.request.user answer.question = self.question answer.save() - if seminar_terminated(self.request.user, answer.question.seminar): - messages.info(self.request, _("You have successfully terminated your e-learning seminar. A training testimonial will be available as soon as the pedagogical team validate all your answers (48h maximum).")) - elif answer.status <= 2: + if answer.status <= 2: messages.info(self.request, _("You have successfully saved your answer")) elif answer.status == 3: messages.info(self.request, _("You have successfully submitted your answer"))