]> git.parisson.com Git - teleforma.git/commitdiff
Fix seminar progress with webclass conference : https://trackers.pilotsystems.net...
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 1 Dec 2021 16:06:04 +0000 (17:06 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 1 Dec 2021 16:06:04 +0000 (17:06 +0100)
teleforma/context_processors.py
teleforma/templates/teleforma/seminar_detail.html

index 2b210929fc48ca95296827862b35e7a74907721b..b4cf33d05518303ba7be4aaad20ede9f70b798ff 100644 (file)
@@ -61,15 +61,18 @@ def seminar_progress(user, seminar, more=False):
         {
             'obj': seminar.docs_correct,
             'step': '5'
-        }]
-    if seminar.conference and seminar.conference.webclass:
-        objects[2]['obj'] = seminar.conference
+        }
+    ]
+    if seminar.conference and seminar.conference.webclass and seminar.conference in user.auditor.get().conferences.all():
+        objects[1]['obj'] = seminar.conference
     for item in objects:
+        
         obj = item['obj']
         step = item['step']
         items = [obj]
         if hasattr(obj, 'all'):
             items = obj.all()
+
         for item in items:
             if item.weight:
                 total += item.weight
@@ -109,6 +112,7 @@ def seminar_progress(user, seminar, more=False):
         progress = int(progress*100/total)
     else:
         progress = 0
+
     if not more:
         return progress
     else:
index b9da46f31fda2c56f30cbd08787930d49480d65f..756590bfe96da14e23cf52042fb1af462ad79f9a 100644 (file)
   </div>
   {% endwith %}
 
-  {% if seminar.conference.webclass and not seminar.medias.all.count %}
+  {% if seminar.conference.webclass and seminar.conference in user.auditor.get.conferences.all %}
     {% with seminar.conference as webclass %}
     <div class="course_content">
       <div class="course_subtitle">
   </div>
   {% endwith %}
 
-  {% if seminar.conference.webclass or not seminar.conference in user.auditor.get.conferences.all %}
 
   {% with seminar.question as questions %}
   <div class="course_content">
 
   {% if seminar_progress == 100 %}
 
-  {% with seminar.form as form %}
-  <div class="course_content">
-    <div class="course_subtitle">
-      <h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 6 :
-        {% trans "evaluate the seminar" %}</h3>
+    {% with seminar.form as form %}
+    <div class="course_content">
+      <div class="course_subtitle">
+        <h3><img src="{{ STATIC_URL }}/telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 6 :
+          {% trans "evaluate the seminar" %}</h3>
+      </div>
+      {% include "teleforma/inc/evaluation_form.html" %}
     </div>
-    {% include "teleforma/inc/evaluation_form.html" %}
-  </div>
-  {% endwith %}
+    {% endwith %}
   {% endif %}
 
   {% if seminar_validated and seminar_progress == 100 and delta_sec >= 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>
+    <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>
+      </div>
+      {% include "teleforma/inc/testimonial_list.html" %}
     </div>
-    {% include "teleforma/inc/testimonial_list.html" %}
-  </div>
-  {% endif %}
-
   {% endif %}
 
   {% endblock course_content %}