From: Guillaume Pellerin Date: Thu, 30 May 2013 14:06:57 +0000 (+0200) Subject: * update tables against mezzanine 1.4.7 X-Git-Tag: 2.8.1-pro~488^2~2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=15e0f1a66710cf80011b4d09f3d018748cf326ac;p=teleforma.git * update tables against mezzanine 1.4.7 * fix testimonial dates --- diff --git a/setup.py b/setup.py index 7548e3ad..405120ee 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,8 @@ setup( 'django-tinymce', 'django-forms-builder', 'xhtml2pdf', + 'xlwt', + 'django-google-tools', ], platforms=['OS Independent'], license='CeCILL v2', diff --git a/teleforma/models/pro.py b/teleforma/models/pro.py index 628e5ac9..e5e54e6f 100755 --- a/teleforma/models/pro.py +++ b/teleforma/models/pro.py @@ -294,4 +294,5 @@ class SeminarRevision(models.Model): db_table = app_label + '_' + 'seminar_revisions' verbose_name = _('Seminar revision') verbose_name_plural = _('Seminar revisions') + ordering = ['date'] diff --git a/teleforma/templates/teleforma/seminar_testimonial.html b/teleforma/templates/teleforma/seminar_testimonial.html index 4e1d7cf7..128dfd22 100644 --- a/teleforma/templates/teleforma/seminar_testimonial.html +++ b/teleforma/templates/teleforma/seminar_testimonial.html @@ -38,8 +38,8 @@ {% trans "Course" %} : {{ seminar.course }} {% trans "Training type" %} : E-learning {% trans "Duration" %} : {{ seminar.duration|hours }} {% trans "hours" %} - {% trans "Training begin date" %} : {{ user.date_joined|date:'j F Y' }} - {% trans "Training end date" %} : {{ user.last_login|date:'j F Y' }} + {% trans "Training begin date" %} : {{ first_revision.date|date:'j F Y' }} + {% trans "Training end date" %} : {{ testimonial.date_added|date:'j F Y' }} diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index e7a028a8..6aaf0dc9 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -128,7 +128,6 @@ class SeminarView(SeminarAccessMixin, DetailView): context = super(SeminarView, self).get_context_data(**kwargs) seminar = context['seminar'] user = self.request.user - progress = seminar_progress(user, seminar) validated = seminar_validated(user, seminar) context['seminar_progress'] = progress @@ -607,6 +606,14 @@ class TestimonialView(PDFTemplateResponseMixin, SeminarView): pdf_template_name = 'teleforma/seminar_testimonial.html' # pdf_filename = 'report.pdf' + def get_context_data(self, **kwargs): + context = super(TestimonialView, self).get_context_data(**kwargs) + seminar = context['seminar'] + context['first_revision'] = SeminarRevision.objects.filter(seminar=seminar, + user=self.request.user)[0] + context['testimonial'] = Testimonial.objects.filter(seminar=seminar, + user=self.request.user)[0] + return context @method_decorator(login_required) def dispatch(self, *args, **kwargs):