From: yomguy Date: Fri, 14 Dec 2012 13:47:14 +0000 (+0100) Subject: fix titles, admin select width, locales.. X-Git-Tag: 0.9-probarreau~257 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=354fe7064c4b691360f5f22b377d3eb0aa95186e;p=teleforma.git fix titles, admin select width, locales.. --- diff --git a/teleforma/admin.py b/teleforma/admin.py index f19461c8..f5f32fa0 100644 --- a/teleforma/admin.py +++ b/teleforma/admin.py @@ -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) diff --git a/teleforma/locale/fr/LC_MESSAGES/django.mo b/teleforma/locale/fr/LC_MESSAGES/django.mo index 9582235a..b05773f0 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 70691086..0478b938 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: 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 \n" "Language-Team: LANGUAGE \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" diff --git a/teleforma/locale/fr/LC_MESSAGES/djangojs.mo b/teleforma/locale/fr/LC_MESSAGES/djangojs.mo index 25d2600c..47f1e117 100644 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 index 00000000..e3c29f6d --- /dev/null +++ b/teleforma/static/admin/extra.css @@ -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; +} + + diff --git a/teleforma/templates/teleforma/inc/document_simple_list.html b/teleforma/templates/teleforma/inc/document_simple_list.html index 5c076a12..a699b05a 100644 --- a/teleforma/templates/teleforma/inc/document_simple_list.html +++ b/teleforma/templates/teleforma/inc/document_simple_list.html @@ -4,7 +4,7 @@
-

{% trans "Read the following documents" %}

+

{{ title }}

diff --git a/teleforma/templates/teleforma/inc/media_package_list.html b/teleforma/templates/teleforma/inc/media_package_list.html index b364076f..b5cb6259 100644 --- a/teleforma/templates/teleforma/inc/media_package_list.html +++ b/teleforma/templates/teleforma/inc/media_package_list.html @@ -4,7 +4,7 @@
-

{% trans "Play the following conferences" %}

+

{{ title }}

diff --git a/teleforma/templates/teleforma/inc/question_list.html b/teleforma/templates/teleforma/inc/question_list.html index 08399f5e..f6118e9c 100644 --- a/teleforma/templates/teleforma/inc/question_list.html +++ b/teleforma/templates/teleforma/inc/question_list.html @@ -4,7 +4,7 @@
-

{% trans "Answer to the following questions" %}

+

{{ title }}

@@ -12,7 +12,7 @@ {% for question in questions.all %} - + {% endfor %} diff --git a/teleforma/templates/teleforma/seminar_detail.html b/teleforma/templates/teleforma/seminar_detail.html index da55c81a..5ee4b5fc 100644 --- a/teleforma/templates/teleforma/seminar_detail.html +++ b/teleforma/templates/teleforma/seminar_detail.html @@ -40,26 +40,36 @@ {% 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 %} diff --git a/teleforma/templatetags/teleforma_tags.py b/teleforma/templatetags/teleforma_tags.py index b3449c15..ef9f5669 100644 --- a/teleforma/templatetags/teleforma_tags.py +++ b/teleforma/templatetags/teleforma_tags.py @@ -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 + diff --git a/teleforma/views/core.py b/teleforma/views/core.py index a0cbfe7c..fec6bc89 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -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') diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 5322fa68..503aaa2e 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -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
{{ question.title }} n°{{ question.rank }}{% if question|submitted:user %}{% endif %}