]> git.parisson.com Git - teleforma.git/commitdiff
fix titles, admin select width, locales..
authoryomguy <yomguy@parisson.com>
Fri, 14 Dec 2012 13:47:14 +0000 (14:47 +0100)
committeryomguy <yomguy@parisson.com>
Fri, 14 Dec 2012 13:47:14 +0000 (14:47 +0100)
12 files changed:
teleforma/admin.py
teleforma/locale/fr/LC_MESSAGES/django.mo
teleforma/locale/fr/LC_MESSAGES/django.po
teleforma/locale/fr/LC_MESSAGES/djangojs.mo
teleforma/static/admin/extra.css [new file with mode: 0644]
teleforma/templates/teleforma/inc/document_simple_list.html
teleforma/templates/teleforma/inc/media_package_list.html
teleforma/templates/teleforma/inc/question_list.html
teleforma/templates/teleforma/seminar_detail.html
teleforma/templatetags/teleforma_tags.py
teleforma/views/core.py
teleforma/views/pro.py

index f19461c872dfebdcd1d22b547b1495a2df01e7eb..f5f32fa04629568805bd7fadbeddb9680a25d9ad 100644 (file)
@@ -72,6 +72,9 @@ class SeminarAdmin(admin.ModelAdmin):
     filter_horizontal = ['professor', 'media', 'media_preview', 
                          'docs_1', 'docs_2', 'docs_correct']
 
+    class Media:
+        css = { 'all': ('admin/extra.css',) }
+
 
 admin.site.unregister(User)
 admin.site.register(User, UserProfileAdmin)
index 9582235a18cae9e67679933c5992d078c3f39249..b05773f06fb030df166791dad3500fb8ad3e0a8c 100644 (file)
Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ
index 706910863f4b405308f0f69eedc56478859c53ed..0478b938906c5730f5a6db24a6cdb556c08d4786 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-12-11 16:31+0100\n"
+"POT-Creation-Date: 2012-12-14 11:49+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"
@@ -18,7 +18,7 @@ msgstr ""
 
 #: models/ae.py:46 models/core.py:177 models/crfpa.py:108 models/crfpa.py:146
 #: models/pro.py:166 models/pro.py:206 models/pro.py:221 models/pro.py:232
-#: models/pro.py:263
+#: models/pro.py:265
 msgid "user"
 msgstr "utilisateur"
 
@@ -91,12 +91,12 @@ msgstr "titre"
 msgid "code"
 msgstr "cote"
 
-#: models/core.py:150 models/core.py:376 models/pro.py:120 models/pro.py:264
+#: models/core.py:150 models/core.py:376 models/pro.py:120 models/pro.py:266
 msgid "date modified"
 msgstr "date de modification"
 
-#: models/core.py:151 models/core.py:420 models/pro.py:58 models/pro.py:95
-#: models/pro.py:150 models/pro.py:211
+#: models/core.py:151 models/core.py:420 models/core.py:478 models/pro.py:58
+#: models/pro.py:95 models/pro.py:150 models/pro.py:211
 msgid "rank"
 msgstr "rang"
 
@@ -150,7 +150,7 @@ msgstr "date de début"
 msgid "end date"
 msgstr "date de fin"
 
-#: models/core.py:225 models/core.py:423 models/core.py:478 models/pro.py:50
+#: models/core.py:225 models/core.py:423 models/core.py:479 models/pro.py:50
 msgid "readers"
 msgstr ""
 
@@ -277,38 +277,38 @@ msgstr "iej"
 msgid "student"
 msgstr "étudiant"
 
-#: models/crfpa.py:147 models/pro.py:238
+#: models/crfpa.py:147 models/pro.py:239
 #: templates/telemeta/profile_detail.html:82
 msgid "Address"
 msgstr "Adresse"
 
-#: models/crfpa.py:148 models/pro.py:239
+#: models/crfpa.py:148 models/pro.py:240
 msgid "Postal code"
 msgstr "Code postal"
 
-#: models/crfpa.py:149 models/pro.py:240
+#: models/crfpa.py:149 models/pro.py:241
 msgid "City"
 msgstr "Ville"
 
-#: models/crfpa.py:150 models/pro.py:241
+#: models/crfpa.py:150 models/pro.py:242
 msgid "Country"
 msgstr "Pays"
 
-#: models/crfpa.py:151 models/pro.py:242
+#: models/crfpa.py:151 models/pro.py:243
 #: templates/telemeta/profile_detail.html:91
 msgid "Language"
 msgstr "Langue"
 
-#: models/crfpa.py:152 models/pro.py:243
+#: models/crfpa.py:152 models/pro.py:244
 #: templates/telemeta/profile_detail.html:83
 msgid "Telephone"
 msgstr "Téléphone"
 
-#: models/crfpa.py:153 models/pro.py:244
+#: models/crfpa.py:153 models/pro.py:246
 msgid "Expiration_date"
 msgstr "Date d'expiration"
 
-#: models/crfpa.py:154 models/pro.py:245
+#: models/crfpa.py:154 models/pro.py:247
 msgid "Password initialized"
 msgstr "Mot de passe initialisé"
 
@@ -372,11 +372,12 @@ msgstr "document 2"
 msgid "corrected document"
 msgstr "document corrigé"
 
-#: models/pro.py:138
+#: models/pro.py:138 templates/teleforma/seminar_media_audio.html:56
+#: templates/teleforma/seminar_media_video.html:102
 msgid "Seminar"
 msgstr "Sémimaire"
 
-#: models/pro.py:146 models/pro.py:205 models/pro.py:220 models/pro.py:262
+#: models/pro.py:146 models/pro.py:205 models/pro.py:220 models/pro.py:264
 msgid "seminar"
 msgstr "séminaire"
 
@@ -436,19 +437,27 @@ msgstr "Évaluation"
 msgid "seminars"
 msgstr "séminaires"
 
-#: models/pro.py:255
+#: models/pro.py:238
+msgid "Company"
+msgstr ""
+
+#: models/pro.py:245
+msgid "Fax"
+msgstr ""
+
+#: models/pro.py:257
 msgid "Auditor"
 msgstr "Auditeur"
 
-#: models/pro.py:265
+#: models/pro.py:267
 msgid "progress"
 msgstr ""
 
-#: models/pro.py:269
+#: models/pro.py:271
 msgid "Revision"
 msgstr "Révision"
 
-#: models/pro.py:270
+#: models/pro.py:272
 msgid "Revisions"
 msgstr "Révisions"
 
@@ -727,15 +736,15 @@ msgstr ""
 msgid "Write"
 msgstr ""
 
-#: templates/teleforma/answer_form.html:23
+#: templates/teleforma/answer_form.html:21
 msgid "Answer to the following question"
 msgstr "Réalisez les consultations fictives suivantes"
 
-#: templates/teleforma/answer_form.html:37
+#: templates/teleforma/answer_form.html:35
 msgid "Save"
 msgstr ""
 
-#: templates/teleforma/answer_form.html:41
+#: templates/teleforma/answer_form.html:39
 msgid "Submit it"
 msgstr "Soumettre"
 
@@ -749,7 +758,7 @@ msgstr "Supports écrits"
 #: templates/teleforma/course_document.html:73
 #: templates/teleforma/inc/conference_list.html:25
 #: templates/teleforma/inc/media_list.html:36
-#: templates/teleforma/inc/media_package_list.html:36
+#: templates/teleforma/inc/media_package_list.html:35
 #: templates/telemeta/lists.html:69 templates/telemeta/search_criteria.html:97
 #: templates/telemeta/inc/module_revisions.html:17
 msgid "Title"
@@ -758,13 +767,15 @@ msgstr "Titre"
 #: templates/teleforma/course.html:18 templates/teleforma/course.html.py:34
 #: templates/teleforma/seminar_detail.html:34
 #: templates/teleforma/seminars.html:80
-#: templates/teleforma/inc/media_package_list.html:41
+#: templates/teleforma/inc/media_package_list.html:40
 msgid "Description"
 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:64
+#: templates/teleforma/seminar_media_video.html:110
 #: templates/telemeta/profile_detail.html:86
 msgid "Date added"
 msgstr "Date d'ajout"
@@ -794,7 +805,7 @@ msgstr "Session"
 #: templates/teleforma/course_media.html:133
 #: templates/teleforma/inc/conference_list.html:27
 #: templates/teleforma/inc/media_list.html:39
-#: templates/teleforma/inc/media_package_list.html:38
+#: templates/teleforma/inc/media_package_list.html:37
 #: templates/telemeta/inc/user_list.html:48
 msgid "Professor"
 msgstr "Professeur"
@@ -806,6 +817,7 @@ msgstr "S T O P"
 
 #: templates/teleforma/course_conference.html:37
 #: templates/teleforma/course_media.html:73
+#: templates/teleforma/seminar_media_video.html:68
 msgid "Audio"
 msgstr ""
 
@@ -853,6 +865,7 @@ msgstr "ID Conférence"
 
 #: templates/teleforma/course_conference_audio.html:36
 #: templates/teleforma/course_media.html:76
+#: templates/teleforma/seminar_media_audio.html:22
 msgid "Video"
 msgstr ""
 
@@ -877,32 +890,43 @@ msgstr "Enregistrer et diffuser"
 
 #: templates/teleforma/course_media.html:27
 #: templates/teleforma/course_media.html:79
+#: templates/teleforma/seminar_media_audio.html:25
+#: templates/teleforma/seminar_media_video.html:20
+#: templates/teleforma/seminar_media_video.html:71
 #: templates/teleforma/inc/media_list.html:50
-#: templates/teleforma/inc/media_package_list.html:49
+#: templates/teleforma/inc/media_package_list.html:48
 msgid " published"
 msgstr " publié"
 
 #: templates/teleforma/course_media.html:34
 #: templates/teleforma/course_media.html:79
+#: templates/teleforma/seminar_media_audio.html:25
+#: templates/teleforma/seminar_media_video.html:27
+#: templates/teleforma/seminar_media_video.html:71
 #: templates/teleforma/inc/media_list.html:52
-#: templates/teleforma/inc/media_package_list.html:51
+#: templates/teleforma/inc/media_package_list.html:50
 msgid " rejected"
 msgstr " rejeté"
 
 #: templates/teleforma/course_media.html:62
+#: templates/teleforma/seminar_media_audio.html:10
+#: templates/teleforma/seminar_media_video.html:56
 #: templates/teleforma/inc/document_list.html:22
-#: templates/teleforma/inc/document_simple_list.html:16
+#: templates/teleforma/inc/document_simple_list.html:15
 #: templates/teleforma/inc/media_list.html:56
-#: templates/teleforma/inc/media_package_list.html:55
-#: templates/teleforma/inc/question_list.html:16
+#: templates/teleforma/inc/media_package_list.html:54
 msgid "Download"
 msgstr "Télécharger"
 
 #: templates/teleforma/course_media.html:141
+#: templates/teleforma/seminar_media_audio.html:63
+#: templates/teleforma/seminar_media_video.html:109
 msgid "Mime type"
 msgstr "Type mime"
 
 #: templates/teleforma/course_media.html:143
+#: templates/teleforma/seminar_media_audio.html:65
+#: templates/teleforma/seminar_media_video.html:111
 msgid "Date modified"
 msgstr "Date de modification"
 
@@ -910,7 +934,7 @@ msgstr "Date de modification"
 msgid "Media ID"
 msgstr "ID Média"
 
-#: templates/teleforma/courses.html:23 templates/teleforma/seminars.html:25
+#: templates/teleforma/courses.html:23
 #: templates/telemeta/profile_detail.html:16
 msgid "My courses"
 msgstr "Mes matières"
@@ -937,10 +961,44 @@ msgstr "Aide"
 msgid "Informations"
 msgstr "Informations"
 
-#: templates/teleforma/seminar_detail.html:73
+#: templates/teleforma/seminar_detail.html:43
+msgid "Step 1 : read the following documents"
+msgstr "Étape 1 : lisez les documents suivants"
+
+#: templates/teleforma/seminar_detail.html:49
+msgid "Step 2 : view the following conferences"
+msgstr "Étape 2 : visionnez les conférences suivantes"
+
+#: templates/teleforma/seminar_detail.html:55
+msgid "Step 3 : read the following documents"
+msgstr "Étape 3 : lisez les documents suivants"
+
+#: templates/teleforma/seminar_detail.html:61
+msgid "Step 4 : answer to the following questions"
+msgstr "Étape 4 : réalisez les consultations fictives suivantes"
+
+#: templates/teleforma/seminar_detail.html:68
+msgid "Step 5 : read the following corrected documents"
+msgstr "Étape 5 : lisez les documents corrigés suivants"
+
+#: templates/teleforma/seminar_detail.html:83
 msgid "Progression"
 msgstr "Progression"
 
+#: templates/teleforma/seminar_media_audio.html:58
+#: templates/teleforma/seminar_media_video.html:104
+msgid "Professors"
+msgstr "Professeurs"
+
+#: templates/teleforma/seminar_media_audio.html:66
+#: templates/teleforma/seminar_media_video.html:112
+msgid "Media package ID"
+msgstr "ID Media pakage"
+
+#: templates/teleforma/seminars.html:25
+msgid "My seminars"
+msgstr "Mes séminaires"
+
 #: templates/teleforma/inc/conference_list.html:8
 msgid "Live conferences"
 msgstr "Conférences en direct"
@@ -954,8 +1012,8 @@ msgstr "Voir"
 #: templates/teleforma/inc/conference_list.html:19
 #: templates/teleforma/inc/media_list.html:23
 #: templates/teleforma/inc/media_list.html:29
-#: templates/teleforma/inc/media_package_list.html:23
-#: templates/teleforma/inc/media_package_list.html:29
+#: templates/teleforma/inc/media_package_list.html:22
+#: templates/teleforma/inc/media_package_list.html:28
 msgid "Click here"
 msgstr "Cliquez ici"
 
@@ -963,30 +1021,23 @@ msgstr "Cliquez ici"
 msgid "No document"
 msgstr "Aucun document"
 
-#: templates/teleforma/inc/document_simple_list.html:7
-msgid "Read the following documents"
-msgstr "Lisez les documents suivants"
-
 #: templates/teleforma/inc/media_list.html:8
 msgid "Passed conferences"
 msgstr "Conférences en différé"
 
 #: templates/teleforma/inc/media_list.html:17
-#: templates/teleforma/inc/media_package_list.html:17
+#: templates/teleforma/inc/media_package_list.html:16
 msgid "Play"
 msgstr "Lire"
 
-#: templates/teleforma/inc/media_package_list.html:7
-msgid "Play the following conferences"
-msgstr "Visionnez les conférences suivantes"
-
-#: templates/teleforma/inc/media_package_list.html:43
+#: templates/teleforma/inc/media_package_list.html:42
 msgid "Duration"
 msgstr "Durée"
 
-#: templates/teleforma/inc/question_list.html:7
-msgid "Answer to the following questions"
-msgstr "Réalisez les consultations fictives suivantes"
+#: templates/teleforma/inc/question_list.html:15
+#, fuzzy
+msgid "Submitted"
+msgstr "Soumettre"
 
 #: templates/telemeta/base.html:99
 msgid "Desk"
@@ -1224,7 +1275,6 @@ msgid "Grouped message"
 msgstr "Message groupé"
 
 #: templates/telemeta/users.html:74
-#, fuzzy
 msgid "No users"
 msgstr "Aucun utilisateur"
 
index 25d2600cf3cdaa2def73735f1359ecd358555e23..47f1e117e7faf4195896899aafc665d1360fa18a 100644 (file)
Binary files a/teleforma/locale/fr/LC_MESSAGES/djangojs.mo and b/teleforma/locale/fr/LC_MESSAGES/djangojs.mo differ
diff --git a/teleforma/static/admin/extra.css b/teleforma/static/admin/extra.css
new file mode 100644 (file)
index 0000000..e3c29f6
--- /dev/null
@@ -0,0 +1,19 @@
+
+.selector {
+    width: 960px;
+    float: left;
+}
+
+.selector select {
+    width: 460px;
+    height: 17.2em;
+}
+
+.selector-available, .selector-chosen {
+    float: left;
+    width: 460px;
+    text-align: center;
+    margin-bottom: 5px;
+}
+
+
index 5c076a129beb4d60a302d276ee19abbdb9b5e22b..a699b05ae926b2c1b7d0d3ab45427e7da653318f 100644 (file)
@@ -4,7 +4,7 @@
 <div class="course_content">
 
 <div class="course_subtitle">
-<h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Read the following documents" %}</h3>
+<h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {{ title }}</h3>
 </div>
 
 <table class="listing" width="100%">
index b364076f477fa9e2b9b76c990ea11a202125451d..b5cb625965a7d01d6fc8200775c465ed57d52e9d 100644 (file)
@@ -4,7 +4,7 @@
 
 <div class="course_content">
 <div class="course_subtitle">
-    <h3><img src="{{ STATIC_URL }}telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Play the following conferences" %}</h3>
+    <h3><img src="{{ STATIC_URL }}telemeta/images/item_title.png" width="10px" alt="" /> {{ title }}</h3>
 </div>
     <table class="listing" width="100%">
     <tbody>
index 08399f5ea1375a0823128fbd42fc451b203db53f..f6118e9c39bec87a9bdfdc23121e6700995c1e5e 100644 (file)
@@ -4,7 +4,7 @@
 <div class="course_content">
 
 <div class="course_subtitle">
-<h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Answer to the following questions" %}</h3>
+<h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {{ title }}</h3>
 </div>
 
 <table class="listing" width="100%">
@@ -12,7 +12,7 @@
         {% for question in questions.all %}
             <tr>
             <td {% if forloop.first %}class="border-top"{% endif %} width="60%"><a href="{% url teleforma-question-answer question.id %}">{{ question.title }} n°{{ question.rank }}</a></td>
-            <td {% if forloop.first %}class="border-top"{% endif %} width="5%" align="center"><img src="{{ STATIC_URL }}teleforma/images/download.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" /></td>
+            <td {% if forloop.first %}class="border-top"{% endif %} width="5%" align="center">{% if question|submitted:user %}<img src="{{ STATIC_URL }}telemeta/images/ok.png" style="vertical-align:middle" alt="" title="{% trans "Submitted" %}" />{% endif %}</td>
             </tr>
         {% endfor %}
     </tbody>
index da55c81ab1378910977106d898292e010bf6fee9..5ee4b5fc7488b2aa741212fcca42e32cdad8085b 100644 (file)
         </div>
 
           {% with seminar.docs_1 as docs %}
-           {% include "teleforma/inc/document_simple_list.html" %}
+           {% with _("Step 1 : read the following documents") as title %}
+            {% include "teleforma/inc/document_simple_list.html" %}
+           {% endwith %}
           {% endwith %}
 
           {% with seminar.media as media_packages %}
-           {% include "teleforma/inc/media_package_list.html" %}
+           {% with _("Step 2 : view the following conferences") as title %}
+            {% include "teleforma/inc/media_package_list.html" %}
+           {% endwith %}
           {% endwith %}
         
           {% with seminar.docs_2 as docs %}
-           {% include "teleforma/inc/document_simple_list.html" %}
+           {% with _("Step 3 : read the following documents") as title %}
+            {% include "teleforma/inc/document_simple_list.html" %}
+           {% endwith %}
           {% endwith %}
           
           {% with seminar.question as questions %}
-           {% include "teleforma/inc/question_list.html" %}
+           {% with _("Step 4 : answer to the following questions") as title %}
+            {% include "teleforma/inc/question_list.html" %}
+           {% endwith %}
           {% endwith %}
 
          {% if validated %}
           {% with seminar.docs_correct as docs %}
-           {% include "teleforma/inc/document_simple_list.html" %}
+            {% with _("Step 5 : read the following corrected documents") as title %}
+             {% include "teleforma/inc/document_simple_list.html" %}
+            {% endwith %}
           {% endwith %}
-        {% endif %}
+         {% endif %}
 
       {% endblock course_content %}
 
index b3449c1513332cacf139bbafd8fb30e848df8a20..ef9f56692eef2dfb434ef1ced8a6053ec69185f6 100644 (file)
@@ -214,4 +214,13 @@ def sub(value, arg):
 @register.filter
 def div(value, arg):
     "Divides the value by the arg"
-    return int(value) / int(arg)
\ No newline at end of file
+    return int(value) / int(arg)
+
+@register.filter
+def submitted(question, user):
+    answers = Answer.objects.filter(question=question, user=user, status=3)
+    if answers:
+        return True
+    else:
+        return False
+
index a0cbfe7ccc4b93581733dcfed84a5ff1896539b9..fec6bc897a5363878d8ba8863a03e22a5e4b16f8 100644 (file)
@@ -358,7 +358,6 @@ class DocumentView(DetailView):
         courses = get_courses(request.user)
         seminars = get_seminars(request.user)
         document = Document.objects.get(id=pk)
-        document.readers.add(request.user)
         if get_course_access(document, courses) or get_seminar_access(document, seminars):
             document.readers.add(request.user)
             fsock = open(document.file.path, 'r')
index 5322fa6854e123b56de271c7ae6ec5f72d86214a..503aaa2e880057a8f1c01260895e0bf3b8811749 100644 (file)
@@ -79,7 +79,7 @@ def seminar_progress(user, seminar):
     questions = Question.objects.filter(seminar=seminar, status=3)
     for question in questions:
         total += question.weight
-        answer = Answer.objects.filter(question=question, validated=True, user=user)
+        answer = Answer.objects.filter(question=question, status=3, user=user)
         if answer:
             progress += question.weight
 
@@ -106,12 +106,14 @@ def total_progress(user):
         return 100
 
 def seminar_validated(user, seminar):
-    validated = False
+    validated = []
     for question in seminar.question.all():
-        answers = question.answer.filter(user=user)
+        answers = Answer.objects.filter(question= question, user=user, validated=True)
         if answers:
-            validated = validated and answers[0].validated
-    return validated
+            validated.append(True)
+        else:
+            validated.append(False)
+    return not False in validated
 
 
 class SeminarView(DetailView):
@@ -239,6 +241,7 @@ class MediaPackageView(DetailView):
     def get_context_data(self, **kwargs):
         context = super(MediaPackageView, self).get_context_data(**kwargs)
         media_package = self.get_object()
+        media_package.readers.add(self.request.user)
         seminar = media_package.seminar.get()
         all_seminars = get_seminars(self.request.user)
         context['all_seminars'] = all_seminars