From: Guillaume Pellerin Date: Tue, 14 Jul 2015 10:01:08 +0000 (+0200) Subject: add script list to professor X-Git-Tag: 1.1~226 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=22bdee0ab014c93d995855d725009470e17884c2;p=teleforma.git add script list to professor --- diff --git a/teleforma/exam/templates/exam/inc/script_list.html b/teleforma/exam/templates/exam/inc/script_list.html index 622533c3..d3892877 100644 --- a/teleforma/exam/templates/exam/inc/script_list.html +++ b/teleforma/exam/templates/exam/inc/script_list.html @@ -3,7 +3,7 @@ {% load teleforma_tags %} {% load pagination_tags %} -{% autopaginate object_list 8 %} +{% autopaginate object_list 15 %} {% paginate %}
diff --git a/teleforma/exam/templates/exam/scores.html b/teleforma/exam/templates/exam/scores.html index d90fb0e1..8040a3b0 100644 --- a/teleforma/exam/templates/exam/scores.html +++ b/teleforma/exam/templates/exam/scores.html @@ -42,6 +42,6 @@

-{% include_container data.chartcontainer 600 '100%' %} +{% include_container data.chartcontainer 500 '100%' %} {% endblock answers %} diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index ffe322a9..2d81687c 100644 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -40,7 +40,7 @@ class ScriptView(CourseAccessMixin, UpdateView): access = self.request.user == script.author or \ self.request.user == script.corrector or \ self.request.user.is_superuser or \ - self.request.user.is_staff + self.request.user.is_staff or self.request.user.professor.all() if not access: context['access_error'] = access_error @@ -99,11 +99,20 @@ class ScriptsTreatedView(ScriptsView): def get_queryset(self): user = self.request.user + professor = user.professor.all() period = Period.objects.get(id=self.kwargs['period_id']) - if user.professor.all(): - Q1 = Q(status=4, period=period) - Q2 = Q(status=5, period=period) - scripts = Script.objects.filter(Q1 | Q2) + if professor: + professor = professor[0] + i = 0 + for course in professor.courses.all(): + Q1 = Q(status=4, period=period, course=course) + Q2 = Q(status=5, period=period, course=course) + if i == 0: + QT = Q1 | Q2 + else: + QT = QT | Q1 | Q2 + i += 1 + scripts = Script.objects.filter(QT) else: Q1 = Q(status=4, author=user, period=period) Q2 = Q(status=5, author=user, period=period) diff --git a/teleforma/templatetags/teleforma_tags.py b/teleforma/templatetags/teleforma_tags.py index 24f0253a..b73c020c 100644 --- a/teleforma/templatetags/teleforma_tags.py +++ b/teleforma/templatetags/teleforma_tags.py @@ -237,7 +237,7 @@ def get_training_profile(user): if student: student = student[0] if student.platform_only: - text += '(I)' + text += 'Internaute - ' for training in student.trainings.all(): - text += ' - ' + unicode(training) + text += unicode(training) + ' ' return text diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index bb6824cd..ac8b9527 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -237,13 +237,15 @@ class UserXLSBook(object): row.write(8, get_course_code(student.oral_2)) profile = Profile.objects.filter(user=user) + student = Student.objects.get(user=user) if profile: profile = Profile.objects.get(user=user) row.write(10, profile.address) row.write(11, profile.postal_code) row.write(12, profile.city) row.write(13, profile.telephone) - row.write(14, user.date_joined.strftime("%d/%m/%Y")) + if student.date_subscribed: + row.write(14, student.date_subscribed.strftime("%d/%m/%Y")) row.write(15, student.total_payments) row.write(16, student.total_fees)