]> git.parisson.com Git - teleforma.git/commitdiff
fix seminar description
authoryomguy <yomguy@parisson.com>
Wed, 2 Jan 2013 15:36:51 +0000 (16:36 +0100)
committeryomguy <yomguy@parisson.com>
Wed, 2 Jan 2013 15:36:51 +0000 (16:36 +0100)
teleforma/context_processors.py
teleforma/locale/fr/LC_MESSAGES/django.mo
teleforma/locale/fr/LC_MESSAGES/django.po
teleforma/static/teleforma/css/teleforma.css
teleforma/templates/teleforma/answer_form.html
teleforma/templates/teleforma/inc/seminar_description.html [new file with mode: 0644]
teleforma/templates/teleforma/seminar_detail.html
teleforma/templates/teleforma/seminars.html
teleforma/templatetags/teleforma_tags.py
teleforma/views/pro.py

index b844a4d6ca96b51db71352986749ec83e02ba9d9..b534b26098b8c0f07c1480e0f3f245c4d4288959 100644 (file)
@@ -75,6 +75,18 @@ 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)
+            if answers:
+                validated.append(True)
+            else:
+                validated.append(False)
+        return not False in validated
+    return False
 
 def all_seminars(request, progress_order=False):
     seminars = []
index 4b835cb842e57a3544159e7b5b9ad56dacea2302..745bc6bf7136467bc76c8a02e23c1aec51637092 100644 (file)
Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ
index 5e2bb4e1e46d965d99078263108d639495ceef0f..28bb012d334b7513c619cd41cb9570cea1ae19e9 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-01-02 15:50+0100\n"
+"POT-Creation-Date: 2013-01-02 16:36+0100\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: Guillaume Pellerin <yomguy@parisson.com>\n"
 "Language-Team: LANGUAGE <lists@parisson.com>\n"
@@ -63,8 +63,7 @@ msgstr "nom"
 #: models/core.py:91 models/core.py:103 models/core.py:126 models/core.py:138
 #: models/core.py:153 models/core.py:204 models/core.py:312 models/core.py:378
 #: models/core.py:398 models/crfpa.py:48 models/pro.py:147 models/pro.py:193
-#: templates/teleforma/seminar_detail.html:71
-#: templates/teleforma/seminars.html:113
+#: templates/teleforma/inc/seminar_description.html:11
 msgid "description"
 msgstr "description"
 
@@ -126,7 +125,7 @@ msgid "types"
 msgstr "types"
 
 #: models/core.py:175 models/core.py:222 models/core.py:414 models/core.py:474
-#: models/pro.py:87 templates/teleforma/seminar_detail.html:65
+#: models/pro.py:87 templates/teleforma/inc/seminar_description.html:5
 msgid "course"
 msgstr "matière"
 
@@ -345,13 +344,11 @@ msgstr ""
 msgid "Seminar type"
 msgstr "Type de séminaire"
 
-#: models/pro.py:89 templates/teleforma/seminar_detail.html:67
-#: templates/teleforma/seminars.html:109
+#: models/pro.py:89 templates/teleforma/inc/seminar_description.html:7
 msgid "public concerned"
 msgstr "public concerné"
 
-#: models/pro.py:90 templates/teleforma/seminar_detail.html:66
-#: templates/teleforma/seminars.html:108
+#: models/pro.py:90 templates/teleforma/inc/seminar_description.html:6
 msgid "level"
 msgstr "niveau"
 
@@ -388,7 +385,7 @@ msgid "form"
 msgstr "formulaire"
 
 #: models/pro.py:137 templates/teleforma/answer_form.html:77
-#: templates/teleforma/seminar_detail.html:180
+#: templates/teleforma/seminar_detail.html:170
 #: templates/teleforma/seminar_media_audio.html:56
 #: templates/teleforma/seminar_media_video.html:104
 #: templates/teleforma/testimonials.html:64
@@ -452,7 +449,7 @@ msgid "Testimonial template"
 msgstr "Modèle d'attestation"
 
 #: models/pro.py:219 templates/teleforma/inc/testimonial_list.html:14
-#: views/pro.py:482
+#: views/pro.py:484
 msgid "Testimonial"
 msgstr "Attestation"
 
@@ -770,17 +767,71 @@ msgid "Submit it"
 msgstr "Soumettre"
 
 #: templates/teleforma/answer_form.html:70
-#: templates/teleforma/seminar_detail.html:174
-#: templates/teleforma/seminars.html:128
+#: templates/teleforma/seminar_detail.html:164
+#: templates/teleforma/seminars.html:120
 msgid "Progressions"
 msgstr "Progressions"
 
 #: templates/teleforma/answer_form.html:74
-#: templates/teleforma/seminar_detail.html:177
-#: templates/teleforma/seminars.html:131
+#: templates/teleforma/seminar_detail.html:167
+#: templates/teleforma/seminars.html:123
 msgid "General"
 msgstr "Général"
 
+#: templates/teleforma/answer_form.html:94
+msgid "Steps"
+msgstr ""
+
+#: templates/teleforma/answer_form.html:99
+#: templates/teleforma/seminar_detail.html:78
+msgid "Step 1 : read these documents"
+msgstr "Étape 1 : lire ces documents"
+
+#: templates/teleforma/answer_form.html:103
+#: templates/teleforma/seminar_detail.html:82
+msgid "Step 1 : read this document"
+msgstr "Étape 1 : lire ce document"
+
+#: templates/teleforma/answer_form.html:111
+#: templates/teleforma/seminar_detail.html:90
+msgid "Step 2 : view these conferences"
+msgstr "Étape 2 : visionner ces conférences"
+
+#: templates/teleforma/answer_form.html:115
+#: templates/teleforma/seminar_detail.html:94
+msgid "Step 2 : view this conference"
+msgstr "Étape 2 : visionner cette conférence"
+
+#: templates/teleforma/answer_form.html:123
+#: templates/teleforma/seminar_detail.html:102
+msgid "Step 3 : read these documents"
+msgstr "Étape 3 : lire ces documents"
+
+#: templates/teleforma/answer_form.html:127
+#: templates/teleforma/seminar_detail.html:106
+msgid "Step 3 : read this document"
+msgstr "Étape 3 : lire ce document"
+
+#: templates/teleforma/answer_form.html:135
+#: templates/teleforma/seminar_detail.html:114
+msgid "Step 4 : answer to these questions"
+msgstr "Étape 4 : réaliser ces consultations fictives"
+
+#: templates/teleforma/answer_form.html:141
+#: templates/teleforma/seminar_detail.html:120
+msgid "Step 4 : answer to this question"
+msgstr "Étape 4 : réaliser cette consultation fictive"
+
+#: templates/teleforma/answer_form.html:151
+#: templates/teleforma/seminar_detail.html:130
+msgid "Step 5 : read these corrected documents"
+msgstr "Étape 5 : lire ces documents corrigés"
+
+#: templates/teleforma/answer_form.html:155
+#: templates/teleforma/seminar_detail.html:134
+msgid "Step 5 : read this corrected document"
+msgstr "Étape 5 : lire ce document corrigé"
+
 #: templates/teleforma/answers.html:6 templates/teleforma/answers.html:62
 #: templates/telemeta/base.html:112
 msgid "Answers"
@@ -1005,12 +1056,12 @@ msgstr "Mes notes"
 msgid "New note"
 msgstr "Nouvelle note"
 
-#: templates/teleforma/courses.html:104 templates/teleforma/seminars.html:143
+#: templates/teleforma/courses.html:104 templates/teleforma/seminars.html:135
 msgid "Status"
 msgstr "Status"
 
 #: templates/teleforma/evaluation_form.html:10
-#: templates/teleforma/seminar_detail.html:151
+#: templates/teleforma/seminar_detail.html:141
 msgid "Step 6 : evaluate the seminar"
 msgstr "Étape 6 : évaluer ce séminaire"
 
@@ -1023,62 +1074,11 @@ msgstr "Aide"
 msgid "Informations"
 msgstr "Informations"
 
-#: templates/teleforma/seminar_detail.html:68
-#: templates/teleforma/seminars.html:110
-msgid "duration"
-msgstr "durée"
-
-#: templates/teleforma/seminar_detail.html:69
-#: templates/teleforma/seminar_testimonial.html:42
-#: templates/teleforma/seminars.html:111
-msgid "keywords"
-msgstr "mots clés"
-
-#: templates/teleforma/seminar_detail.html:88
-msgid "Step 1 : read these documents"
-msgstr "Étape 1 : lire ces documents"
-
-#: templates/teleforma/seminar_detail.html:92
-msgid "Step 1 : read this document"
-msgstr "Étape 1 : lire ce document"
-
-#: templates/teleforma/seminar_detail.html:100
-msgid "Step 2 : view these conferences"
-msgstr "Étape 2 : voir ces conférences"
-
-#: templates/teleforma/seminar_detail.html:104
-msgid "Step 2 : view this conference"
-msgstr "Étape 2 : voir cette conférence"
-
-#: templates/teleforma/seminar_detail.html:112
-msgid "Step 3 : read these documents"
-msgstr "Étape 3 : lire ces documents"
-
-#: templates/teleforma/seminar_detail.html:116
-msgid "Step 3 : read this document"
-msgstr "Étape 3 : lire ce document"
-
-#: templates/teleforma/seminar_detail.html:124
-msgid "Step 4 : answer to these questions"
-msgstr "Étape 4 : réaliser ces consultations fictives"
-
-#: templates/teleforma/seminar_detail.html:130
-msgid "Step 4 : answer to this question"
-msgstr "Étape 4 : réaliser cette consultation fictive"
-
-#: templates/teleforma/seminar_detail.html:140
-msgid "Step 5 : read these corrected documents"
-msgstr "Étape 5 : lire ces documents corrigés"
-
-#: templates/teleforma/seminar_detail.html:144
-msgid "Step 5 : read this corrected document"
-msgstr "Étape 5 : lire ce document corrigé"
-
-#: templates/teleforma/seminar_detail.html:158
+#: templates/teleforma/seminar_detail.html:148
 msgid "Step 7 : download your testimonial"
 msgstr ""
 
-#: templates/teleforma/seminar_detail.html:192
+#: templates/teleforma/seminar_detail.html:182
 msgid "Index"
 msgstr "Index"
 
@@ -1117,6 +1117,11 @@ msgstr ""
 msgid "Training type"
 msgstr "Type de formation"
 
+#: templates/teleforma/seminar_testimonial.html:42
+#: templates/teleforma/inc/seminar_description.html:9
+msgid "keywords"
+msgstr "mots clés"
+
 #: templates/teleforma/seminar_testimonial.html:46
 msgid "Training begin date"
 msgstr "Date de début de formation"
@@ -1220,6 +1225,14 @@ msgstr "enregistrée le"
 msgid "Validated"
 msgstr "validé"
 
+#: templates/teleforma/inc/seminar_description.html:8
+msgid "duration"
+msgstr "durée"
+
+#: templates/teleforma/inc/seminar_description.html:8
+msgid "hours"
+msgstr "heures"
+
 #: templates/telemeta/base.html:96
 msgid "Desk"
 msgstr "Bureau"
@@ -1476,14 +1489,24 @@ msgstr ""
 "obtenir un accès privé."
 
 #: views/pro.py:154
+msgid ""
+"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)."
+msgstr ""
+"Vous avez achevé avec succès votre séminaire e-learning. Une attestation de "
+"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
 msgid "You have successfully saved your answer"
 msgstr "Vous avez enregistré votre reponse avec succès"
 
-#: views/pro.py:156
+#: views/pro.py:158
 msgid "You have successfully submitted your answer"
 msgstr "Vous avez soumis votre reponse avec succès"
 
-#: views/pro.py:354
+#: views/pro.py:356
 msgid "You have successfully sumitted your evaluation"
 msgstr "Vous avez soumis votre évaluation avec succès"
 
index 7b096b8645a93b1031f2e4115267d122c0554a91..d0e320b6443bbf6c3dfa161e7e88d034318bbfde 100644 (file)
@@ -1831,6 +1831,8 @@ form .exceed{
     border-radius: 8px 0px 8px 8px;
     color: black;
     padding: 0.5em;
+    max-height: 300px;
+    overflow-y: auto;
 }
 
 
index 479c69b8cb8ccc19bbd400ce95d6e34d4b94421e..89f955d16075dd8317eefce2b05f85bb59005ca2 100644 (file)
@@ -88,3 +88,78 @@ $(document).ready(function(){
 </div>
 {% endblock progress %}
 
+
+{% block index %}
+<div class="module">
+  <h3><img src="{{STATIC_URL}}telemeta/images/module_playlist.png" alt="status" style="vertical-align:middle" /> {% trans "Steps" %}</h3>
+ <div id="index">
+  
+          {% with seminar.docs_1 as docs %}
+           {% if docs.all.count > 1 %}
+            {% with _("Step 1 : read these documents") as title %}
+             {% include "teleforma/inc/document_simple_list.html" %}
+           {% endwith %}
+           {% else %}
+            {% with _("Step 1 : read this document") as title %}
+             {% include "teleforma/inc/document_simple_list.html" %}
+            {% endwith %}
+           {% endif %}
+          {% endwith %}
+
+          {% with seminar.media as media_packages %}
+           {% if media_packages.all.count > 1 %}
+            {% with _("Step 2 : view these conferences") as title %}
+             {% include "teleforma/inc/media_package_list.html" %}
+            {% endwith %}
+           {% else %}
+            {% with _("Step 2 : view this conference") as title %}
+             {% include "teleforma/inc/media_package_list.html" %}
+            {% endwith %}
+           {% endif %}
+          {% endwith %}
+
+          {% with seminar.docs_2 as docs %}
+           {% if docs.all.count > 1 %}
+            {% with _("Step 3 : read these documents") as title %}
+             {% include "teleforma/inc/document_simple_list.html" %}
+           {% endwith %}
+           {% else %}
+            {% with _("Step 3 : read this document") as title %}
+             {% include "teleforma/inc/document_simple_list.html" %}
+            {% endwith %}
+           {% endif %}
+          {% endwith %}
+            
+          {% with seminar.question as questions %}
+           {% if questions.all.count > 1 %}
+            {% with _("Step 4 : answer to these questions") as title %}
+             {% include "teleforma/inc/question_list.html" %}
+            {% endwith %}
+           {% else %}
+
+
+            {% with _("Step 4 : answer to this question") as title %}
+             {% include "teleforma/inc/question_list.html" %}
+            {% endwith %}
+           {% endif %}
+          {% endwith %}
+
+        
+         {% if seminar_progress == 100 %}
+          {% with seminar.docs_correct as docs %}
+           {% if docs.all.count > 1 %}
+            {% with _("Step 5 : read these corrected documents") as title %}
+             {% include "teleforma/inc/document_simple_list.html" %}
+            {% endwith %}
+           {% else %}
+            {% with _("Step 5 : read this corrected document") as title %}
+             {% include "teleforma/inc/document_simple_list.html" %}
+            {% endwith %}
+           {% endif %}
+          {% endwith %}
+         {% endif %}
+
+
+ </div>
+</div>
+{% endblock index %}
diff --git a/teleforma/templates/teleforma/inc/seminar_description.html b/teleforma/templates/teleforma/inc/seminar_description.html
new file mode 100644 (file)
index 0000000..8c47cfa
--- /dev/null
@@ -0,0 +1,14 @@
+{% load teleforma_tags %}
+{% load i18n %}
+
+<dl class="listing" style="font-size: 1.1em;">
+<dt>{% trans "course" %}</dt><dd>{{ seminar.course }}</dd>
+<dt>{% trans "level" %}</dt><dd>{{ seminar.level }}</dd>
+<dt>{% trans "public concerned" %}</dt><dd>{{ seminar.concerned }}</dd>
+<dt>{% trans "duration" %}</dt><dd>{{ seminar.duration|hours }} {% trans "hours" %}</dd>
+{% if seminar.keywords.all %}<dt>{% trans "keywords" %}</dt><dd><div class="keywords">{% for kw in seminar.keywords.all %}{{ kw }}{% if not forloop.last %},{% endif %} {% endfor %}</div></dd>{% endif %}
+<!-- {% if seminar.description %}
+<dt>{% trans "description" %}</dt><dd><div class="description">{{ seminar.description|safe }}</div></dd>
+{% endif %}
+-->
+</dl>
\ No newline at end of file
index 4a4cc6cb71f16be251e83b1cfc8f11f1c0cc42ed..fc569827885c05ea2d6fb5fa5c71373a1cadcead 100644 (file)
@@ -61,17 +61,7 @@ $(function () {
              <h3><img src="{{ STATIC_URL }}telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Informations" %}</h3>
             </div>
             <div class="course_description">
-              <dl class="listing" style="font-size: 1.1em;">
-              <dt>{% trans "course" %}</dt><dd>{{ seminar.course }}</dd>
-              <dt>{% trans "level" %}</dt><dd>{{ seminar.level }}</dd>
-              <dt>{% trans "public concerned" %}</dt><dd>{{ seminar.concerned }}</dd>
-              <dt>{% trans "duration" %}</dt><dd>{{ seminar.duration }}</dd>
-              {% if seminar.keywords.all %}<dt>{% trans "keywords" %}</dt><dd><div class="keywords">{% for kw in seminar.keywords.all %}{{ kw }}, {% endfor %}</div></dd>{% endif %}
-              <!-- {% if seminar.description %}
-              <dt>{% trans "description" %}</dt><dd><div class="description">{{ seminar.description|safe }}</div></dd>
-              {% endif %}
-              -->
-            </dl>
+              {% include "teleforma/inc/seminar_description.html" %} 
             </div>
         {% if messages %}
          <div class="messages">
index 68f7ecaa6c6d71022e8399ecf7f2e667e965a382..70b6eae8625372fbfc337b1c711e33686f15c3f5 100644 (file)
@@ -104,15 +104,7 @@ $(function() {
             <div class="course_subtitle">
             </div>
             <div class="course_description">
-              <dl class="listing" style="font-size: 1.1em;">
-              <dt>{% trans "level" %}</dt><dd>{{ seminar.level }}</dd>
-              <dt>{% trans "public concerned" %}</dt><dd>{{ seminar.concerned }}</dd>
-              <dt>{% trans "duration" %}</dt><dd>{{ seminar.duration }}</dd>
-              {% if seminar.keywords.all %}<dt>{% trans "keywords" %}</dt><dd><div class="keywords">{% for kw in seminar.keywords.all %}{{ kw }}, {% endfor %}</div></dd>{% endif %}
-              {% if seminar.description %}
-              <dt>{% trans "description" %}</dt><dd><div class="description">{{ seminar.description|safe }}</div></dd>
-              {% endif %}
-            </dl>
+              {% include "teleforma/inc/seminar_description.html" %} 
             </div>
         </div>
       </div>
index 3019bd4c47e3cce660f7a032edafae5e2cf2ec9e..fb9d7eb3b3c1984cbc705bff5570f83c52c29894 100644 (file)
@@ -272,3 +272,8 @@ def free_first(qs):
 @register.simple_tag
 def admin_username():
     return settings.ADMIN_USERNAME
+
+@register.filter
+def hours(time):
+    return str(int(str(time).split(':')[0]))
+
index b41b028bb147ec85c455e2143f83cfa633a1dfd7..3805cddc5bbe26eef52f744964abb313e0ef836f 100644 (file)
@@ -150,7 +150,9 @@ class AnswerView(FormView):
         answer.user = self.request.user
         answer.question = self.question
         answer.save()
-        if answer.status <= 2:
+        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:
             messages.info(self.request, _("You have successfully saved your answer"))
         elif answer.status == 3:
             messages.info(self.request, _("You have successfully submitted your answer"))