]> git.parisson.com Git - teleforma.git/commitdiff
try seminar time constraint
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 21 Jul 2014 21:40:04 +0000 (23:40 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 21 Jul 2014 21:40:04 +0000 (23:40 +0200)
teleforma/templates/teleforma/seminar_detail.html
teleforma/views/pro.py

index f9c66945de045efeab55650b127fffd15d3c5f7c..0050a6eb0af7aae5538000e5052b575c91b07a7e 100644 (file)
@@ -196,7 +196,7 @@ $(window).ready(function( ){
       {% endwith %}
      {% endif %}
 
-     {% if seminar_validated and seminar_progress == 100 %}
+     {% if seminar_validated and seminar_progress == 100 and seminar_time >= 0 %}
        <div class="course_content">
         <div class="course_subtitle">
           <h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 7 : {% trans "download your testimonial" %}</h3>
index 1f27555c95505cc41c88e4e34c38ccd4839b4044..01608e44e30f637e86ae44921cbea5359ae09d75 100644 (file)
@@ -59,7 +59,7 @@ from forms_builder.forms.forms import FormForForm
 from forms_builder.forms.models import Form
 from forms_builder.forms.signals import form_invalid, form_valid
 
-REVISION_DATE_FILTER = datetime.datetime(2014,7,19)
+REVISION_DATE_FILTER = datetime.datetime(2014,7,21)
 
 
 def content_to_pdf(content, dest, encoding='utf-8', **kwargs):
@@ -161,6 +161,7 @@ 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
@@ -171,8 +172,14 @@ class SeminarView(SeminarAccessMixin, DetailView):
             messages.info(self.request, _("All your answers have been validated. You can now read the corrected documents (step 5)."))
         elif progress == 100 and validated and self.template_name == 'teleforma/seminar_detail.html':
             messages.info(self.request, _("You have successfully terminated all steps of your e-learning seminar. You can now download your training testimonial below."))
+
         delta = self.get_delta(user, seminar)
         context['delta'] = str(delta).split('.')[0]
+        #TODO
+        if datetime.datetime.now > REVISION_DATE_FILTER:
+            context['seminar_time'] = delta - datetime.timedelta(seconds=seminar.duration.as_seconds())
+        else:
+            context['seminar_time'] = 1
         return context
 
     @jsonrpc_method('teleforma.publish_seminar')