]> git.parisson.com Git - teleforma.git/commitdiff
* update tables against mezzanine 1.4.7
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 30 May 2013 14:06:57 +0000 (16:06 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 30 May 2013 14:06:57 +0000 (16:06 +0200)
* fix testimonial dates

setup.py
teleforma/models/pro.py
teleforma/templates/teleforma/seminar_testimonial.html
teleforma/views/pro.py

index 7548e3ad75cfb7922bdcfd818683ae02053e0e0e..405120ee3d70c5758f93e5a5c7d139cb9d78daf8 100644 (file)
--- 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',
index 628e5ac90e4e84f2d2b543e8cc51c2f43620584c..e5e54e6f706e6afe7d0ae76e17f09c06764ba0c2 100755 (executable)
@@ -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']
 
index 4e1d7cf74e869f3349bfd6b26ab5ee6eb9613477..128dfd22dfc8614066de4d2fbb92a0b839caee6d 100644 (file)
@@ -38,8 +38,8 @@
       <tr><td class="bold">{% trans "Course" %} : </td><td>{{ seminar.course }}</td></tr>
       <tr><td class="bold">{% trans "Training type" %} : </td><td>E-learning</td></tr>
       <tr><td class="bold">{% trans "Duration" %} : </td><td>{{ seminar.duration|hours }} {% trans "hours" %}</td></tr>
-      <tr><td class="bold">{% trans "Training begin date" %} : </td><td>{{ user.date_joined|date:'j F Y' }}</td></tr>
-      <tr><td class="bold">{% trans "Training end date" %} : </td><td>{{ user.last_login|date:'j F Y' }}</td></tr>
+      <tr><td class="bold">{% trans "Training begin date" %} : </td><td>{{ first_revision.date|date:'j F Y' }}</td></tr>
+      <tr><td class="bold">{% trans "Training end date" %} : </td><td>{{ testimonial.date_added|date:'j F Y' }}</td></tr>
     </table>
 
     <table class="table2">
index e7a028a85e79530ce27c31e89a82320d5ccaac19..6aaf0dc924fbbbe3671a0547c6d2cb2e3f2cabae 100644 (file)
@@ -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):