]> git.parisson.com Git - teleforma.git/commitdiff
fix user XLS export, trans
authoryomguy <yomguy@parisson.com>
Wed, 6 Jun 2012 10:37:14 +0000 (12:37 +0200)
committeryomguy <yomguy@parisson.com>
Wed, 6 Jun 2012 10:37:14 +0000 (12:37 +0200)
teleforma/locale/fr/LC_MESSAGES/django.mo
teleforma/locale/fr/LC_MESSAGES/django.po
teleforma/management/commands/teleforma-export-users.py
teleforma/management/commands/teleforma-import-users-pb.py
teleforma/templates/telemeta/profile_detail.html
teleforma/templatetags/teleforma_tags.py
teleforma/views.py

index 0d62673a84749c27aed3cfc5d9a74a85b444c99b..c2884a2fcfc09d932fae6edf23d5d7bf3734ce8b 100644 (file)
Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ
index e7d1f5b4b9c08c5abed427d8c6897f20f98ff327..dbe14aa420f6c20b5f8797f12f7001c0e586e5ba 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-06-05 20:19+0200\n"
+"POT-Creation-Date: 2012-06-06 12:01+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -19,12 +19,12 @@ msgstr ""
 "Plural-Forms: nplurals=2; plural=(n > 1)\n"
 
 #: models.py:69 models.py:81 models.py:99 models.py:111 models.py:166
-#: models.py:291 models.py:383 models.py:399
+#: models.py:292 models.py:384 models.py:400
 msgid "name"
 msgstr "nom"
 
 #: models.py:70 models.py:82 models.py:100 models.py:112 models.py:125
-#: models.py:167 models.py:221 models.py:273 models.py:292 models.py:384
+#: models.py:167 models.py:222 models.py:274 models.py:293 models.py:385
 msgid "description"
 msgstr "description"
 
@@ -36,23 +36,23 @@ msgstr "organisation"
 msgid "department"
 msgstr "département"
 
-#: models.py:107 models.py:400 models.py:445
+#: models.py:107 models.py:401 models.py:446
 msgid "period"
 msgstr "période"
 
-#: models.py:119 models.py:180 models.py:240 models.py:307 models.py:354
+#: models.py:119 models.py:180 models.py:241 models.py:308 models.py:355
 msgid "course type"
 msgstr "type de matière"
 
-#: models.py:124 models.py:272
+#: models.py:124 models.py:273
 msgid "title"
 msgstr "titre"
 
-#: models.py:126 models.py:277 models.py:398
+#: models.py:126 models.py:278 models.py:399
 msgid "code"
 msgstr "cote"
 
-#: models.py:127 models.py:276
+#: models.py:127 models.py:277
 msgid "date modified"
 msgstr "date de modification"
 
@@ -60,23 +60,23 @@ msgstr "date de modification"
 msgid "number"
 msgstr ""
 
-#: models.py:129 models.py:403 models.py:450
+#: models.py:129 models.py:404
 msgid "synthesis note"
 msgstr "note de synthèse"
 
-#: models.py:130
-msgid "obligation"
-msgstr "obligation"
+#: models.py:130 models.py:407
+msgid "obligations"
+msgstr "obligations"
 
-#: models.py:143 models.py:179 models.py:238 models.py:306 models.py:353
+#: models.py:143 models.py:179 models.py:239 models.py:307 models.py:354
 msgid "course"
 msgstr "matière"
 
-#: models.py:149 models.py:444 models.py:486
+#: models.py:149 models.py:445 models.py:483
 msgid "user"
 msgstr "utilisateur"
 
-#: models.py:151 models.py:439 models.py:447
+#: models.py:150 models.py:440 models.py:450
 msgid "training"
 msgstr "formation"
 
@@ -88,200 +88,184 @@ msgstr "matières"
 msgid "professor"
 msgstr "professeur"
 
-#: models.py:174 models.py:184
+#: models.py:174 models.py:185
 msgid "room"
 msgstr "salle"
 
-#: models.py:182
+#: models.py:183
 msgid "session"
 msgstr "session"
 
-#: models.py:186
+#: models.py:187
 msgid "comment"
 msgstr ""
 
-#: models.py:187
+#: models.py:188
 msgid "begin date"
 msgstr "date de début"
 
-#: models.py:188
+#: models.py:189
 msgid "end date"
 msgstr "date de fin"
 
-#: models.py:189 models.py:359
+#: models.py:190 models.py:360
 msgid "is live"
 msgstr "en direct"
 
-#: models.py:190 models.py:314 models.py:360
+#: models.py:191 models.py:315 models.py:361
 msgid "readers"
 msgstr ""
 
-#: models.py:210 models.py:242 models.py:308 models.py:355
+#: models.py:211 models.py:243 models.py:309 models.py:356
 msgid "conference"
 msgstr "conférence"
 
-#: models.py:218
+#: models.py:219
 msgid "host"
 msgstr ""
 
-#: models.py:219
+#: models.py:220
 msgid "port"
 msgstr ""
 
-#: models.py:220 models.py:310
+#: models.py:221 models.py:311
 msgid "type"
 msgstr "type"
 
-#: models.py:222
+#: models.py:223
 msgid "source password"
 msgstr ""
 
-#: models.py:223
+#: models.py:224
 msgid "admin password"
 msgstr ""
 
-#: models.py:230 models.py:245
+#: models.py:231 models.py:246
 msgid "streaming server"
 msgstr "serveur de diffusion"
 
-#: models.py:246
+#: models.py:247
 msgid "Streaming type"
 msgstr "Type de flux"
 
-#: models.py:266
+#: models.py:267
 msgid "live stream"
 msgstr "stream en direct"
 
-#: models.py:274
+#: models.py:275
 msgid "credits"
 msgstr "crédits"
 
-#: models.py:275 models.py:506
+#: models.py:276 models.py:503
 msgid "date added"
 msgstr "date d'ajout"
 
-#: models.py:278
+#: models.py:279
 msgid "published"
 msgstr "publié"
 
-#: models.py:299
+#: models.py:300
 msgid "document type"
 msgstr "type de document"
 
-#: models.py:312
+#: models.py:313
 msgid "annal"
 msgstr "annale"
 
-#: models.py:313
+#: models.py:314
 msgid "file"
 msgstr "fichier"
 
-#: models.py:391 models.py:392 templates/telemeta/profile_detail.html:61
+#: models.py:392 models.py:393 templates/telemeta/profile_detail.html:63
 #: templates/telemeta/users.html:29 templates/telemeta/inc/user_list.html:21
 msgid "IEJ"
 msgstr "IEJ"
 
-#: models.py:406 models.py:453
-msgid "obligations"
-msgstr "obligations"
-
-#: models.py:409
+#: models.py:410 models.py:453
 msgid "procedure"
 msgstr "procédure"
 
-#: models.py:412
+#: models.py:413 models.py:459
 msgid "written speciality"
 msgstr "spécialité écrit"
 
-#: models.py:415
+#: models.py:416 models.py:456
 msgid "oral speciality"
 msgstr "spécialité orale"
 
-#: models.py:418 models.py:421 models.py:464
+#: models.py:419 models.py:422 models.py:461
 msgid "oral 1"
 msgstr ""
 
-#: models.py:424 models.py:468
+#: models.py:425 models.py:465
 msgid "options"
 msgstr "options"
 
-#: models.py:427
+#: models.py:428
 msgid "magitral courses"
 msgstr "Cours magistraux"
 
-#: models.py:429
+#: models.py:430
 msgid "cost"
 msgstr "coût"
 
-#: models.py:446
+#: models.py:448
 msgid "iej"
 msgstr "iej"
 
-#: models.py:448
+#: models.py:451
 msgid "platform only"
-msgstr ""
-
-#: models.py:456
-msgid "procedures"
-msgstr "procédures"
-
-#: models.py:459
-msgid "oral specialities"
-msgstr "spécialités orales"
+msgstr "plateforme seulement"
 
-#: models.py:462
-msgid "written specialities"
-msgstr "spécialités écrites"
-
-#: models.py:466
+#: models.py:463
 msgid "oral 2"
 msgstr ""
 
-#: models.py:479 models.py:504
+#: models.py:476 models.py:501
 msgid "student"
 msgstr "étudiant"
 
-#: models.py:487 templates/telemeta/profile_detail.html:72
+#: models.py:484 templates/telemeta/profile_detail.html:76
 msgid "Address"
 msgstr ""
 
-#: models.py:488
+#: models.py:485
 msgid "Postal code"
 msgstr "Code postal"
 
-#: models.py:489
+#: models.py:486
 msgid "City"
 msgstr "Ville"
 
-#: models.py:490
+#: models.py:487
 msgid "Country"
 msgstr "Pays"
 
-#: models.py:491 templates/telemeta/profile_detail.html:81
+#: models.py:488 templates/telemeta/profile_detail.html:85
 msgid "Language"
 msgstr "Langue"
 
-#: models.py:492 templates/telemeta/profile_detail.html:73
+#: models.py:489 templates/telemeta/profile_detail.html:77
 msgid "Telephone"
 msgstr "Téléphone"
 
-#: models.py:493
+#: models.py:490
 msgid "Expiration_date"
 msgstr "Date d'expiration"
 
-#: models.py:494
+#: models.py:491
 msgid "Password initialization"
 msgstr ""
 
-#: models.py:498
+#: models.py:495
 msgid "profile"
 msgstr "profil"
 
-#: models.py:505
+#: models.py:502
 msgid "amount"
 msgstr "montant"
 
-#: models.py:514
+#: models.py:511
 msgid "payment"
 msgstr "paiement"
 
@@ -499,7 +483,7 @@ msgstr ""
 msgid "Conversation"
 msgstr ""
 
-#: templates/postman/view.html:9 templates/telemeta/inc/user_list.html:67
+#: templates/postman/view.html:9 templates/telemeta/inc/user_list.html:69
 #, fuzzy
 msgid "Message"
 msgstr "Messages"
@@ -516,34 +500,31 @@ msgstr ""
 msgid "Back"
 msgstr ""
 
-#: templates/postman/write.html:3 templates/telemeta/inc/user_list.html:27
+#: templates/postman/write.html:3 templates/telemeta/inc/user_list.html:28
 msgid "Write"
 msgstr ""
 
 #: templates/teleforma/course.html:15
-#: templates/teleforma/inc/document_list.html:6
+#: templates/teleforma/inc/document_list.html:7
 msgid "Documents"
 msgstr "Supports écrits"
 
 #: templates/teleforma/course.html:18 templates/teleforma/course.html.py:34
 #: templates/teleforma/course_conference.html:33
 #: templates/teleforma/course_document.html:68
-#: templates/teleforma/inc/document_list.html:11
-#: templates/teleforma/inc/media_list.html:11 templates/telemeta/lists.html:69
-#: templates/telemeta/search_criteria.html:97
+#: templates/teleforma/inc/document_list.html:12
+#: templates/telemeta/lists.html:69 templates/telemeta/search_criteria.html:97
 #: templates/telemeta/inc/module_revisions.html:17
 msgid "Title"
 msgstr "Titre"
 
 #: templates/teleforma/course.html:19 templates/teleforma/course.html.py:35
-#: templates/teleforma/inc/document_list.html:12
-#: templates/teleforma/inc/media_list.html:12
 msgid "Description"
 msgstr "Description"
 
 #: templates/teleforma/course.html:20 templates/teleforma/course.html.py:36
 #: templates/teleforma/course.html:53 templates/teleforma/course_media.html:62
-#: templates/telemeta/profile_detail.html:76
+#: templates/telemeta/profile_detail.html:80
 msgid "Date added"
 msgstr "Date d'ajout"
 
@@ -557,15 +538,17 @@ msgstr "Conférences"
 
 #: templates/teleforma/course.html:51
 #: templates/teleforma/course_conference.html:34
-#: templates/teleforma/inc/conference_list.html:13
+#: templates/teleforma/inc/conference_list.html:12
+#: templates/teleforma/inc/media_list.html:12
 msgid "Session"
 msgstr "Session"
 
 #: templates/teleforma/course.html:52
 #: templates/teleforma/course_conference.html:35
 #: templates/teleforma/course_media.html:51
-#: templates/teleforma/inc/conference_list.html:14
-#: templates/telemeta/inc/user_list.html:46
+#: templates/teleforma/inc/conference_list.html:13
+#: templates/teleforma/inc/media_list.html:13
+#: templates/telemeta/inc/user_list.html:48
 msgid "Professor"
 msgstr "Professeur"
 
@@ -581,13 +564,9 @@ msgstr "Fin"
 msgid "Live"
 msgstr "Direct"
 
-#: templates/teleforma/course_detail.html:50
-#: templates/teleforma/courses.html:83
-msgid "No document"
-msgstr "Aucun document"
-
 #: templates/teleforma/course_media.html:57
-#: templates/teleforma/inc/conference_list.html:15
+#: templates/teleforma/inc/conference_list.html:14
+#: templates/teleforma/inc/media_list.html:14
 msgid "Begin date"
 msgstr "Date de début"
 
@@ -604,29 +583,19 @@ msgstr "Type mime"
 msgid "My courses"
 msgstr "Mes matières"
 
-#: templates/teleforma/courses.html:36
+#: templates/teleforma/courses.html:38
 msgid "My notes"
 msgstr "Mes notes"
 
-#: templates/teleforma/courses.html:46
+#: templates/teleforma/courses.html:48
 msgid "New note"
 msgstr "Nouvelle note"
 
-#: templates/teleforma/inc/conference_list.html:6
+#: templates/teleforma/inc/conference_list.html:7
 msgid "Live conference"
 msgstr "Conférence en direct"
 
-#: templates/teleforma/inc/conference_list.html:11
-#: templates/telemeta/lists.html:70
-#: templates/telemeta/inc/module_revisions.html:18
-msgid "Type"
-msgstr ""
-
-#: templates/teleforma/inc/conference_list.html:12
-msgid "Room"
-msgstr "Salle"
-
-#: templates/teleforma/inc/conference_list.html:16
+#: templates/teleforma/inc/conference_list.html:15
 msgid "Streaming"
 msgstr "Diffusion"
 
@@ -635,7 +604,6 @@ msgid "Annal"
 msgstr "Annale"
 
 #: templates/teleforma/inc/document_list.html:14
-#: templates/teleforma/inc/media_list.html:13
 msgid "Date modified"
 msgstr "Date de modification"
 
@@ -643,10 +611,18 @@ msgstr "Date de modification"
 msgid "Download"
 msgstr "Télécharger"
 
-#: templates/teleforma/inc/media_list.html:6
+#: templates/teleforma/inc/document_list.html:37
+msgid "No document"
+msgstr "Aucun document"
+
+#: templates/teleforma/inc/media_list.html:7
 msgid "Passed conferences"
 msgstr "Conférences passées"
 
+#: templates/teleforma/inc/media_list.html:15
+msgid "Duration"
+msgstr "Durée"
+
 #: templates/telemeta/base.html:68
 msgid "Desk"
 msgstr "Bureau"
@@ -720,23 +696,26 @@ msgstr ""
 msgid "Add"
 msgstr ""
 
-#: templates/telemeta/lists.html:55 templates/telemeta/profile_detail.html:47
+#: templates/telemeta/lists.html:55 templates/telemeta/profile_detail.html:49
 msgid "Edit"
 msgstr ""
 
+#: templates/telemeta/lists.html:70
+#: templates/telemeta/inc/module_revisions.html:18
+msgid "Type"
+msgstr ""
+
 #: templates/telemeta/lists.html:71
 msgid "Code"
 msgstr ""
 
 #: templates/telemeta/lists.html:72
-#, fuzzy
 msgid "Recordist"
-msgstr "date de d'enregistrement"
+msgstr "Opérateur d'enregistrement"
 
 #: templates/telemeta/lists.html:73
-#, fuzzy
 msgid "Recording period"
-msgstr "date de d'enregistrement"
+msgstr "période d'enregistrement"
 
 #: templates/telemeta/lists.html:74
 #: templates/telemeta/search_criteria.html:149
@@ -757,81 +736,91 @@ msgstr "profil"
 msgid "His courses"
 msgstr "Ses matières"
 
-#: templates/telemeta/profile_detail.html:34
+#: templates/telemeta/profile_detail.html:36
 msgid "Send a message"
 msgstr "Envoyer un message"
 
-#: templates/telemeta/profile_detail.html:42
+#: templates/telemeta/profile_detail.html:44
 #, fuzzy
 msgid "User profile"
 msgstr "profil"
 
-#: templates/telemeta/profile_detail.html:48
+#: templates/telemeta/profile_detail.html:50
 msgid "Change password"
 msgstr ""
 
-#: templates/telemeta/profile_detail.html:56
+#: templates/telemeta/profile_detail.html:58
 #: templates/telemeta/inc/user_list.html:20
 msgid "First Name"
 msgstr ""
 
-#: templates/telemeta/profile_detail.html:57
+#: templates/telemeta/profile_detail.html:59
 #: templates/telemeta/inc/user_list.html:19
 msgid "Last Name"
 msgstr ""
 
-#: templates/telemeta/profile_detail.html:58
+#: templates/telemeta/profile_detail.html:60
 #, fuzzy
 msgid "Username"
 msgstr "nom"
 
-#: templates/telemeta/profile_detail.html:62
+#: templates/telemeta/profile_detail.html:64
 msgid "Training"
 msgstr "Formation"
 
-#: templates/telemeta/profile_detail.html:63
+#: templates/telemeta/profile_detail.html:65
+msgid "Platform only"
+msgstr ""
+
+#: templates/telemeta/profile_detail.html:66
 #: templates/telemeta/inc/user_list.html:22
 msgid "Procedure"
 msgstr "Procédure"
 
-#: templates/telemeta/profile_detail.html:64
+#: templates/telemeta/profile_detail.html:67
 #: templates/telemeta/inc/user_list.html:23
 msgid "Oral spe"
 msgstr "Oral Spé"
 
-#: templates/telemeta/profile_detail.html:65
+#: templates/telemeta/profile_detail.html:68
 #: templates/telemeta/inc/user_list.html:24
 msgid "Written spe"
 msgstr "Ecrit Spé"
 
-#: templates/telemeta/profile_detail.html:66
+#: templates/telemeta/profile_detail.html:69
 #: templates/telemeta/inc/user_list.html:25
 msgid "Oral 1"
 msgstr ""
 
-#: templates/telemeta/profile_detail.html:67
+#: templates/telemeta/profile_detail.html:70
 #: templates/telemeta/inc/user_list.html:26
 msgid "Oral 2"
 msgstr ""
 
 #: templates/telemeta/profile_detail.html:71
+#: templates/telemeta/inc/user_list.html:27
+#, fuzzy
+msgid "Options"
+msgstr "options"
+
+#: templates/telemeta/profile_detail.html:75
 msgid "Email"
 msgstr ""
 
-#: templates/telemeta/profile_detail.html:77
+#: templates/telemeta/profile_detail.html:81
 #, fuzzy
 msgid "Expiration date"
 msgstr "Date d'expiration"
 
-#: templates/telemeta/profile_detail.html:78
+#: templates/telemeta/profile_detail.html:82
 msgid "Last login"
 msgstr ""
 
-#: templates/telemeta/profile_detail.html:89
+#: templates/telemeta/profile_detail.html:93
 msgid "Apply"
 msgstr ""
 
-#: templates/telemeta/profile_detail.html:99
+#: templates/telemeta/profile_detail.html:103
 msgid "Login as"
 msgstr "Se connecter en tant que"
 
@@ -879,11 +868,11 @@ msgstr ""
 msgid "Criteria"
 msgstr ""
 
-#: templates/telemeta/inc/user_list.html:53
+#: templates/telemeta/inc/user_list.html:55
 msgid "Administrator"
 msgstr ""
 
-#: templates/telemeta/inc/user_list.html:60
+#: templates/telemeta/inc/user_list.html:62
 msgid "Unknown"
 msgstr ""
 
@@ -899,6 +888,29 @@ msgstr "Tweeter local"
 msgid "me"
 msgstr "moi"
 
+#: templatetags/teleforma_tags.py:98
+msgid "Yes"
+msgstr ""
+
+#: templatetags/teleforma_tags.py:100
+msgid "No"
+msgstr ""
+
+#~ msgid "obligation"
+#~ msgstr "obligation"
+
+#~ msgid "procedures"
+#~ msgstr "procédures"
+
+#~ msgid "oral specialities"
+#~ msgstr "spécialités orales"
+
+#~ msgid "written specialities"
+#~ msgstr "spécialités écrites"
+
+#~ msgid "Room"
+#~ msgstr "Salle"
+
 #~ msgid "Differed"
 #~ msgstr "Différé"
 
index 5ada83dff0751f8d43c3f5b6e57319c9ee7ff3de..46ce32ba7077e35c7db08d21df330f5d1ee17b5d 100644 (file)
@@ -26,13 +26,16 @@ class Command(BaseCommand):
             row.write(1, user.first_name)
             row.write(9, user.email)
             row.write(2, unicode(student.iej))
-            row.write(3, unicode(student.training.code))
-            row.write(4, unicode(student.procedure))
-            row.write(5, unicode(student.written_speciality))
-            row.write(6, unicode(student.oral_speciality))
-            row.write(7, unicode(student.oral_1))
-            row.write(8, unicode(student.oral_2))
-            row.write(15, unicode(student.category))
+            code = student.training.code
+            if student.platform_only:
+                code = 'I - ' + code
+            row.write(3, unicode(code))
+            row.write(4, unicode(student.procedure.code))
+            row.write(5, unicode(student.written_speciality.code))
+            row.write(6, unicode(student.oral_speciality.code))
+            row.write(7, unicode(student.oral_1.code))
+            row.write(8, unicode(student.oral_2.code))
+            row.write(15, unicode(student.period))
 
             profile = Profile.objects.filter(user=user)
             if profile:
index 58d2fe871f629677d78fba07a2cf19dd740ffd5f..a914da8f21b8530903a764b524234d0955eeaa6b 100644 (file)
@@ -34,6 +34,16 @@ class Command(BaseCommand):
             training = Training.objects.get(code=code)
         return platform_only, training
 
+    def get_iej(self, name):
+        iejs = IEJ.objects.filter(name=name)
+        if iejs:
+            iej = iejs[0]
+        elif not name:
+            iej = None
+        else:
+            iej, c = IEJ.objects.get_or_create(name=name)
+        return iej
+
     def import_user(self, row):
         last_name   = row[0].value
         first_name  = row[1].value
@@ -57,15 +67,9 @@ class Command(BaseCommand):
             student = Student.objects.filter(user=user)
             if not student:
                 student = Student(user=user)
-                student.platform_only, student.training = self.get_training(code=row[3].value)
+                student.platform_only, student.training = self.get_training(row[3].value)
                 student.period = Period.objects.get(name='Estivale')
-                name = row[2].value
-                iejs = IEJ.objects.filter(name=name)
-                if iejs:
-                    iej = iejs[0]
-                else:
-                    iej = None
-                student.iej = iej
+                student.iej = self.get_iej(row[2].value)
                 student.save()
 
             student.procedure = self.get_courses(row[4].value)
index b4890d26a61ed326bf73df22688f368a56b658ff..8a7eb6caaa6df6f0cfdb2eabdda17121d3d4b573 100644 (file)
@@ -62,6 +62,7 @@
       {% if usr.student.get %}
         <dt>{% trans "IEJ" %}</dt><dd><a href="{% url teleforma-iej-users usr.student.get.iej.id %}">{{ usr.student.get.iej }}</a></dd>
         <dt>{% trans "Training" %}</dt><dd><a href="{% url teleforma-training-users usr.student.get.training.id %}">{{ usr.student.get.training }}</a></dd>
+        <dt>{% trans "Platform only" %}</dt><dd>{{ usr.student.get.platform_only|yes_no }}</dd>
         <dt>{% trans "Procedure"%}</dt><dd>{{ usr.student.get.procedure}}</dd>
         <dt>{% trans "Oral spe"%}</dt><dd>{{ usr.student.get.oral_speciality }}</dd>
         <dt>{% trans "Written spe"%}</dt><dd>{{ usr.student.get.written_speciality }}</dd>
index cce6aa6a0c4f7b712fbc22e6d430d3ae2cdde043..2c0ad4eb47bd491ae73edd7a481546ed3cc8aa4f 100644 (file)
@@ -92,3 +92,9 @@ def or_me(value, arg):
         arg = unicode(arg)
     return _('me') if value == arg else value
 
+@register.filter
+def yes_no(bool):
+    if bool:
+        return _('Yes')
+    else:
+        return _('No')
index 72d7e4739e97386ab6f94e50e3cd59bc965669ba..4dfda6615c51e92515c8183f7f83ba4854610b4b 100755 (executable)
@@ -338,6 +338,11 @@ class UsersCourseView(UsersView):
     def dispatch(self, *args, **kwargs):
         return super(UsersCourseView, self).dispatch(*args, **kwargs)
 
+def get_course_code(obj):
+    if obj:
+        return unicode(obj.code)
+    else:
+        return ''
 
 class UsersXLSExport(object):
 
@@ -352,12 +357,15 @@ class UsersXLSExport(object):
             row.write(1, user.first_name)
             row.write(9, user.email)
             row.write(2, unicode(student.iej))
-            row.write(3, unicode(student.training.code))
-            row.write(4, unicode(student.procedure))
-            row.write(5, unicode(student.written_speciality))
-            row.write(6, unicode(student.oral_speciality))
-            row.write(7, unicode(student.oral_1))
-            row.write(8, unicode(student.oral_2))
+            code = student.training.code
+            if student.platform_only:
+                code = 'I - ' + code
+            row.write(3, unicode(code))
+            row.write(4, get_course_code(student.procedure))
+            row.write(5, get_course_code(student.written_speciality))
+            row.write(6, get_course_code(student.oral_speciality))
+            row.write(7, get_course_code(student.oral_1))
+            row.write(8, get_course_code(student.oral_2))
 
             profile = Profile.objects.filter(user=user)
             if profile:
@@ -376,22 +384,30 @@ class UsersXLSExport(object):
         self.users = self.users.order_by('last_name')
         self.book = Workbook()
         self.sheet = self.book.add_sheet('Etudiants')
+
         row = self.sheet.row(0)
-        row.write(0, 'NOM')
-        row.write(1, 'PRENOM')
-        row.write(2, 'IEJ')
-        row.write(3, 'FORMATION')
-        row.write(4, 'PROC')
-        row.write(5, 'Ecrit Spe')
-        row.write(6, 'Oral Spe')
-        row.write(7, 'ORAL 1')
-        row.write(8, 'ORAL 2')
-        row.write(9, 'MAIL')
-        row.write(10, 'ADRESSE')
-        row.write(11, 'CP')
-        row.write(12, 'VILLE')
-        row.write(13, 'TEL')
-        row.write(14, "Date d'inscription")
+        cols = [{'name':'NOM', 'width':5000},
+                {'name':'PRENOM', 'width':5000},
+                {'name':'IEJ', 'width':2500},
+                {'name':'FORMATION', 'width':5000},
+                {'name':'PROC', 'width':2500},
+                {'name':'Ecrit Spe', 'width':2500},
+                {'name':'Oral Spe', 'width':2500},
+                {'name':'ORAL 1', 'width':2500},
+                {'name':'ORAL 2', 'width':2500},
+                {'name':'MAIL', 'width':7500},
+                {'name':'ADRESSE', 'width':7500},
+                {'name':'CP', 'width':2500},
+                {'name':'VILLE', 'width':5000},
+                {'name':'TEL', 'width':5000},
+                {'name':"Date d'inscription", 'width':5000}
+                ]
+        i = 0
+        for col in cols:
+            row.write(i, col['name'])
+            self.sheet.col(i).width = col['width']
+            i += 1
+
         counter = 0
         for user in self.users:
             counter = self.export_user(counter, user)