]> git.parisson.com Git - teleforma.git/commitdiff
Add Payment object for student
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 30 Jan 2015 10:02:29 +0000 (11:02 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 30 Jan 2015 10:02:29 +0000 (11:02 +0100)
Allow script upload for anyone

teleforma/admin.py
teleforma/exam/context_processors.py
teleforma/locale/fr/LC_MESSAGES/django.mo
teleforma/locale/fr/LC_MESSAGES/django.po
teleforma/models/crfpa.py

index 18b844a3667aea0d937a968666d22dd2ea0591b8..3b026cc16a181a59d5e8ccf5e6518411a1b3f528 100644 (file)
@@ -16,9 +16,13 @@ class AEStudentProfileInline(admin.StackedInline):
     filter_horizontal = ['courses']
     extra = 1
 
+class StudentPaymentInline(admin.StackedInline):
+    model = Payment
+
 class StudentAdmin(admin.ModelAdmin):
     model = Student
     exclude = ['options']
+    inlines = [StudentPaymentInline]
 
 class ProfessorProfileInline(admin.StackedInline):
     model = Professor
index 92e64628080df9e48172152b8f3701deccdef2f4..4469d5f9d54ee252186061ad67ccb0d6ef4f9444 100644 (file)
@@ -43,12 +43,13 @@ def exam_access(request):
         students = user.student.all()
         quotas = user.quotas.all()
 
+        # Option for restricting access to platform user only
         if students:
             platform_only = students[0].platform_only
         else:
             platform_only = False
 
-        if platform_only or quotas or user.is_staff or user.is_superuser:
+        if students or quotas or user.is_staff or user.is_superuser:
             return {'exam_access': True}
         else:
             return {'exam_access': False}
index 4a7c5a469a2c171f0ed221c60b198d348b33230f..d2ac9bc3898cedc478a0d3c15ecdf80c9178c569 100644 (file)
Binary files a/teleforma/locale/fr/LC_MESSAGES/django.mo and b/teleforma/locale/fr/LC_MESSAGES/django.mo differ
index dd7870c4be1894b0572993d6eefd438b00f61fa3..177112a71c3f83d846cb828f328129ea3c8b94ed 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-08-03 02:06+0200\n"
+"POT-Creation-Date: 2015-01-29 23:28+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"
@@ -16,7 +16,7 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n > 1)\n"
 
-#: exam/models.py:62 exam/models.py:410
+#: exam/models.py:62 exam/models.py:413
 msgid "rejected"
 msgstr "rejetée"
 
@@ -32,7 +32,7 @@ msgstr "soumise"
 msgid "pending"
 msgstr "en attente"
 
-#: exam/models.py:63 exam/models.py:395
+#: exam/models.py:63 exam/models.py:398
 msgid "marked"
 msgstr "corrigée"
 
@@ -84,22 +84,22 @@ msgstr "pas de fichier"
 msgid "file too large"
 msgstr "fichier trop gros"
 
-#: exam/models.py:119 exam/models.py:205 models/core.py:199 models/core.py:253
-#: models/core.py:493 models/core.py:580 models/pro.py:45
+#: exam/models.py:119 exam/models.py:214 models/core.py:199 models/core.py:256
+#: models/core.py:496 models/core.py:585 models/pro.py:45
 msgid "course"
 msgstr "matière"
 
-#: exam/models.py:120 exam/models.py:212
+#: exam/models.py:120 exam/models.py:221
 msgid "corrector"
 msgstr "correcteur"
 
-#: exam/models.py:121 exam/models.py:206 models/ae.py:47 models/core.py:111
-#: models/core.py:136 models/core.py:251 models/core.py:498 models/core.py:543
-#: models/core.py:584 models/crfpa.py:64
+#: exam/models.py:121 exam/models.py:215 models/ae.py:47 models/core.py:111
+#: models/core.py:136 models/core.py:254 models/core.py:501 models/core.py:547
+#: models/core.py:589 models/crfpa.py:64
 msgid "period"
 msgstr "période"
 
-#: exam/models.py:123
+#: exam/models.py:123 models/crfpa.py:174
 msgid "value"
 msgstr "valeur"
 
@@ -120,118 +120,119 @@ msgstr ""
 msgid "Quotas"
 msgstr ""
 
-#: exam/models.py:161 models/core.py:459 models/pro.py:67
+#: exam/models.py:170 models/core.py:462 models/pro.py:67
 msgid "date added"
 msgstr "date d'ajout"
 
-#: exam/models.py:162 models/core.py:160 models/core.py:460 models/pro.py:68
+#: exam/models.py:171 models/core.py:160 models/core.py:463
+#: models/crfpa.py:177 models/pro.py:68
 msgid "date modified"
 msgstr "date de modification"
 
-#: exam/models.py:163
+#: exam/models.py:172
 msgid "UUID"
 msgstr ""
 
-#: exam/models.py:164
+#: exam/models.py:173
 msgid "MIME type"
 msgstr "Type MIME"
 
-#: exam/models.py:165
+#: exam/models.py:174
 msgid "sha1"
 msgstr ""
 
-#: exam/models.py:181
+#: exam/models.py:190
 msgid "script"
 msgstr "copie"
 
-#: exam/models.py:182
+#: exam/models.py:191
 msgid "Page file"
 msgstr "Fichier de page"
 
-#: exam/models.py:183
+#: exam/models.py:192
 msgid "Image file"
 msgstr "Fichier image"
 
-#: exam/models.py:184 models/pro.py:49 models/pro.py:85
+#: exam/models.py:193 models/pro.py:49 models/pro.py:85
 msgid "rank"
 msgstr "rang"
 
-#: exam/models.py:187
+#: exam/models.py:196
 msgid "Page"
 msgstr "Page"
 
-#: exam/models.py:188
+#: exam/models.py:197
 msgid "Pages"
 msgstr "Pages"
 
-#: exam/models.py:193 models/core.py:93 models/core.py:106 models/core.py:128
-#: models/core.py:141 models/core.py:235 models/core.py:476 models/crfpa.py:47
+#: exam/models.py:202 models/core.py:93 models/core.py:106 models/core.py:128
+#: models/core.py:141 models/core.py:238 models/core.py:479 models/crfpa.py:47
 #: models/crfpa.py:63
 msgid "name"
 msgstr "nom"
 
-#: exam/models.py:196
+#: exam/models.py:205
 msgid "ScriptType"
 msgstr "Type de copie"
 
-#: exam/models.py:197
+#: exam/models.py:206
 msgid "ScriptTypes"
 msgstr "Types de copies"
 
-#: exam/models.py:208 models/core.py:257 models/core.py:502
+#: exam/models.py:217 models/core.py:260 models/core.py:505
 msgid "session"
 msgstr "séance"
 
-#: exam/models.py:210 models/core.py:390 models/core.py:500 models/core.py:588
+#: exam/models.py:219 models/core.py:393 models/core.py:503 models/core.py:593
 msgid "type"
 msgstr "type"
 
-#: exam/models.py:211
+#: exam/models.py:220
 msgid "author"
 msgstr "auteur"
 
-#: exam/models.py:213
+#: exam/models.py:222
 msgid "PDF file"
 msgstr "Fichier PDF"
 
-#: exam/models.py:214
+#: exam/models.py:223
 msgid "Box UUID"
 msgstr ""
 
-#: exam/models.py:215
+#: exam/models.py:224
 msgid "score"
 msgstr "note"
 
-#: exam/models.py:216 models/pro.py:125
+#: exam/models.py:225 models/pro.py:125
 msgid "comments"
 msgstr "commentaires"
 
-#: exam/models.py:217 models/core.py:266 models/pro.py:48 models/pro.py:88
+#: exam/models.py:226 models/core.py:269 models/pro.py:48 models/pro.py:88
 #: models/pro.py:104
 msgid "status"
 msgstr "status"
 
-#: exam/models.py:218
+#: exam/models.py:227
 msgid "reason"
 msgstr "raison"
 
-#: exam/models.py:219
+#: exam/models.py:228
 msgid "date submitted"
 msgstr "date de soumission"
 
-#: exam/models.py:220
+#: exam/models.py:229
 msgid "date marked"
 msgstr "date de correction"
 
-#: exam/models.py:221
+#: exam/models.py:230
 msgid "date rejected"
 msgstr "date de rejet"
 
-#: exam/models.py:222
+#: exam/models.py:231
 msgid "URL"
 msgstr ""
 
-#: exam/models.py:226 exam/templates/exam/inc/script_list.html:14
+#: exam/models.py:235 exam/templates/exam/inc/script_list.html:14
 #: templates/teleforma/course.html:50
 #: templates/teleforma/course_conference.html:40
 #: templates/teleforma/course_conference.html:71
@@ -244,28 +245,28 @@ msgstr ""
 msgid "Session"
 msgstr "Séance"
 
-#: exam/models.py:234 exam/models.py:394 exam/models.py:409
+#: exam/models.py:243 exam/models.py:397 exam/models.py:412
 msgid "Script"
 msgstr "Copie"
 
-#: exam/models.py:235 exam/templates/exam/scripts.html:21
+#: exam/models.py:244 exam/templates/exam/scripts.html:21
 #: templates/telemeta/base.html:116 templates/telemeta/base.html.py:121
 msgid "Scripts"
 msgstr "Copies"
 
-#: exam/views.py:83
+#: exam/views.py:84
 msgid "Pending scripts"
 msgstr "Copies en attente"
 
-#: exam/views.py:100
+#: exam/views.py:101
 msgid "Treated scripts"
 msgstr "Copie traitées"
 
-#: exam/views.py:115
+#: exam/views.py:116
 msgid "Rejected scripts"
 msgstr "Copies rejetées"
 
-#: exam/views.py:128
+#: exam/views.py:129
 msgid ""
 "You have successfully submitted your script. It will be processed in the "
 "next hours."
@@ -273,7 +274,7 @@ msgstr ""
 "Vous avez correctement soumis votre copie. Elle sera traitée dans les "
 "prochaines heures puis corrigée."
 
-#: exam/views.py:132
+#: exam/views.py:133
 msgid ""
 "There was a problem with your submission. Please try again, later if "
 "possible."
@@ -353,15 +354,15 @@ msgstr "Note"
 msgid "Send"
 msgstr "Envoyer"
 
-#: exam/templates/exam/script_form.html:30 exam/templates/exam/scripts.html:38
+#: exam/templates/exam/script_form.html:32 exam/templates/exam/scripts.html:40
 msgid "New script"
 msgstr "Nouvelle copie"
 
-#: exam/templates/exam/script_form.html:33
+#: exam/templates/exam/script_form.html:35
 msgid "Blank script"
 msgstr "Copie vierge"
 
-#: exam/templates/exam/script_form.html:63
+#: exam/templates/exam/script_form.html:66
 msgid "Submit"
 msgstr "Soumettre"
 
@@ -369,7 +370,7 @@ msgstr "Soumettre"
 msgid "Answers"
 msgstr "Réponses"
 
-#: exam/templates/exam/scripts.html:68
+#: exam/templates/exam/scripts.html:71
 msgid "No scripts"
 msgstr "Aucune copie"
 
@@ -435,7 +436,7 @@ msgstr ""
 "NB: Ce message est émis par un automate. Ne faites pas de réponse, elle ne "
 "serait pas prise en compte."
 
-#: models/ae.py:46 models/core.py:206 models/crfpa.py:108 models/crfpa.py:149
+#: models/ae.py:46 models/core.py:206 models/crfpa.py:108 models/crfpa.py:150
 #: models/pro.py:101 models/pro.py:140
 msgid "user"
 msgstr "utilisateur"
@@ -469,12 +470,12 @@ msgid "Public"
 msgstr "Publié"
 
 #: models/core.py:94 models/core.py:107 models/core.py:129 models/core.py:142
-#: models/core.py:157 models/core.py:236 models/core.py:391 models/core.py:457
-#: models/core.py:477 models/crfpa.py:48 models/pro.py:124
+#: models/core.py:157 models/core.py:239 models/core.py:394 models/core.py:460
+#: models/core.py:480 models/crfpa.py:48 models/pro.py:124
 msgid "description"
 msgstr "description"
 
-#: models/core.py:101 models/core.py:109 models/core.py:234 models/pro.py:123
+#: models/core.py:101 models/core.py:109 models/core.py:237 models/pro.py:123
 msgid "organization"
 msgstr "organisation"
 
@@ -482,19 +483,19 @@ msgstr "organisation"
 msgid "Master domain"
 msgstr ""
 
-#: models/core.py:123 models/core.py:155 models/core.py:249
+#: models/core.py:123 models/core.py:155 models/core.py:211 models/core.py:252
 msgid "department"
 msgstr "département"
 
-#: models/core.py:149 models/core.py:254 models/core.py:495 models/core.py:582
+#: models/core.py:149 models/core.py:257 models/core.py:498 models/core.py:587
 msgid "course type"
 msgstr "type de matière"
 
-#: models/core.py:156 models/core.py:456 models/pro.py:46 models/pro.py:83
+#: models/core.py:156 models/core.py:459 models/pro.py:46 models/pro.py:83
 msgid "title"
 msgstr "titre"
 
-#: models/core.py:158 models/core.py:461 models/crfpa.py:62
+#: models/core.py:158 models/core.py:464 models/crfpa.py:62
 msgid "code"
 msgstr "cote"
 
@@ -502,7 +503,7 @@ msgstr "cote"
 msgid "tweeter title"
 msgstr "titre tweeter"
 
-#: models/core.py:161 models/core.py:478
+#: models/core.py:161 models/core.py:481
 msgid "number"
 msgstr "nombre"
 
@@ -518,103 +519,103 @@ msgstr "obligations"
 msgid "magistral"
 msgstr "magistral"
 
-#: models/core.py:228 models/core.py:255
+#: models/core.py:231 models/core.py:258
 msgid "professor"
 msgstr "professeur"
 
-#: models/core.py:243 models/core.py:259
+#: models/core.py:246 models/core.py:262
 msgid "room"
 msgstr "salle"
 
-#: models/core.py:248
+#: models/core.py:251
 msgid "public_id"
 msgstr "public id"
 
-#: models/core.py:261
+#: models/core.py:264
 msgid "comment"
 msgstr "commentaire"
 
-#: models/core.py:262
+#: models/core.py:265
 msgid "begin date"
 msgstr "date de début"
 
-#: models/core.py:263
+#: models/core.py:266
 msgid "end date"
 msgstr "date de fin"
 
-#: models/core.py:264 models/core.py:509 models/core.py:546 models/core.py:589
+#: models/core.py:267 models/core.py:513 models/core.py:551 models/core.py:594
 msgid "readers"
 msgstr ""
 
-#: models/core.py:380 models/core.py:408 models/core.py:496 models/core.py:578
+#: models/core.py:383 models/core.py:411 models/core.py:499 models/core.py:583
 msgid "conference"
 msgstr "conférence"
 
-#: models/core.py:388
+#: models/core.py:391
 msgid "host"
 msgstr "hôte"
 
-#: models/core.py:389
+#: models/core.py:392
 msgid "port"
 msgstr "port"
 
-#: models/core.py:392
+#: models/core.py:395
 msgid "source password"
 msgstr ""
 
-#: models/core.py:393
+#: models/core.py:396
 msgid "admin password"
 msgstr ""
 
-#: models/core.py:400 models/core.py:411
+#: models/core.py:403 models/core.py:414
 msgid "streaming server"
 msgstr "serveur de diffusion"
 
-#: models/core.py:412
+#: models/core.py:415
 msgid "Streaming type"
 msgstr "Type de flux"
 
-#: models/core.py:414
+#: models/core.py:417
 msgid "streaming"
 msgstr "diffusion"
 
-#: models/core.py:450
+#: models/core.py:453
 msgid "live stream"
 msgstr "stream en direct"
 
-#: models/core.py:458
+#: models/core.py:461
 msgid "credits"
 msgstr "crédits"
 
-#: models/core.py:462
+#: models/core.py:465
 msgid "published"
 msgstr "publié"
 
-#: models/core.py:463
+#: models/core.py:466
 msgid "mime type"
 msgstr "Type mime"
 
-#: models/core.py:464 models/pro.py:86
+#: models/core.py:467 models/pro.py:86
 msgid "weight"
 msgstr "poids"
 
-#: models/core.py:485
+#: models/core.py:488
 msgid "document type"
 msgstr "type de document"
 
-#: models/core.py:504 models/crfpa.py:111
+#: models/core.py:507 models/crfpa.py:111
 msgid "iej"
 msgstr "iej"
 
-#: models/core.py:506
+#: models/core.py:509
 msgid "annal"
 msgstr "annale"
 
-#: models/core.py:507
+#: models/core.py:510
 msgid "year"
 msgstr "année"
 
-#: models/core.py:508 models/core.py:545
+#: models/core.py:511 models/core.py:549
 msgid "file"
 msgstr "fichier"
 
@@ -661,53 +662,71 @@ msgid "trainings"
 msgstr "formations"
 
 #: models/crfpa.py:142
-msgid "CRFPA Profile"
-msgstr "Profil CRFPA"
+msgid "Student"
+msgstr "Etudiant"
 
-#: models/crfpa.py:150 templates/telemeta/profile_detail.html:77
+#: models/crfpa.py:143
+msgid "Students"
+msgstr "Etudiants"
+
+#: models/crfpa.py:151 templates/telemeta/profile_detail.html:77
 msgid "Address"
 msgstr "Adresse"
 
-#: models/crfpa.py:151
+#: models/crfpa.py:152
 msgid "Postal code"
 msgstr "Code postal"
 
-#: models/crfpa.py:152
+#: models/crfpa.py:153
 msgid "City"
 msgstr "Ville"
 
-#: models/crfpa.py:153
+#: models/crfpa.py:154
 msgid "Country"
 msgstr "Pays"
 
-#: models/crfpa.py:154 templates/telemeta/profile_detail.html:88
+#: models/crfpa.py:155 templates/telemeta/profile_detail.html:88
 msgid "Language"
 msgstr "Langue"
 
-#: models/crfpa.py:155 templates/telemeta/profile_detail.html:78
+#: models/crfpa.py:156 templates/telemeta/profile_detail.html:78
 msgid "Telephone"
 msgstr "Téléphone"
 
-#: models/crfpa.py:156
+#: models/crfpa.py:157
 msgid "Expiration_date"
 msgstr "Date d'expiration"
 
-#: models/crfpa.py:157
+#: models/crfpa.py:158
 msgid "Password initialized"
 msgstr "Mot de passe initialisé"
 
-#: models/crfpa.py:158 templates/telemeta/profile_detail.html:79
+#: models/crfpa.py:159 templates/telemeta/profile_detail.html:79
 msgid "WiFi login"
 msgstr ""
 
-#: models/crfpa.py:159
+#: models/crfpa.py:160
 msgid "WiFi pass"
 msgstr ""
 
-#: models/crfpa.py:163
+#: models/crfpa.py:164
 msgid "profile"
 msgstr "profil"
 
+#: models/crfpa.py:173
+#, fuzzy
+msgid "student"
+msgstr "Etudiant AE"
+
+#: models/crfpa.py:175
+msgid "month"
+msgstr ""
+
+#: models/crfpa.py:176
+#, fuzzy
+msgid "date created"
+msgstr "date de rejet"
+
 #: models/pro.py:47
 msgid "price"
 msgstr "prix"
@@ -1527,6 +1546,9 @@ msgstr ""
 msgid "A new live conference has started : "
 msgstr "Une nouvelle conférence en direct a commencé : "
 
+#~ msgid "CRFPA Profile"
+#~ msgstr "Profil CRFPA"
+
 #~ msgid "Validate"
 #~ msgstr "Validée"
 
index 39f75f4fb75cd82ba98c2a2cbb6195f8b68107f4..ab92e382fcf725ca6cc1b00b55aec06a5a5fb712 100644 (file)
@@ -139,7 +139,8 @@ class Student(Model):
 
     class Meta(MetaCore):
         db_table = app_label + '_' + 'student'
-        verbose_name = _('CRFPA Profile')
+        verbose_name = _('Student')
+        verbose_name_plural = _('Students')
         ordering = ['user__last_name']
 
 
@@ -163,3 +164,21 @@ class Profile(models.Model):
         verbose_name = _('profile')
 
 
+months_choices = []
+for i in range(1,13):
+    months_choices.append((i, _(datetime.date(2015, i, 1).strftime('%B'))))
+
+class Payment(models.Model):
+    "a payment from a student"
+    
+    student = models.ForeignKey(Student, related_name='payments', verbose_name=_('student'))
+    value = models.FloatField(_('value'))
+    month = models.IntegerField(_('month'), choices=months_choices, default=1)
+    date_created = models.DateTimeField(_('date created'), auto_now_add=True)
+    date_modified = models.DateTimeField(_('date modified'), auto_now=True)
+
+    class Meta:
+        db_table = app_label + '_' + 'payments'
+        verbose_name = "Payment"
+        verbose_name_plural = "Payments"
+