]> git.parisson.com Git - teleforma.git/commitdiff
improve webclass filtering feature/bbb_media
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 10 Feb 2021 14:18:24 +0000 (15:18 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 10 Feb 2021 14:18:24 +0000 (15:18 +0100)
teleforma/templates/teleforma/inc/media_list.html
teleforma/webclass/templates/webclass/inc/webclass_list.html

index 8b841c9dcaed987ad17cf25ed70c165fdf97dd44..55d5a9a4e80399466a337f85ece625b1a0830132 100644 (file)
@@ -2,7 +2,7 @@
 {% load thumbnail %}
 {% load i18n %}
 
-{% if course.media.all|from_course_type:type|from_period:period or other_records %}
+{% if course.media.all|from_course_type:type|from_period:period or webclass_records %}
 <div class="course_content content_video">
 <div class="course_subtitle">
     <h3><img src="/static/telemeta/images/item_title.png" width="10px" alt="" /> {% trans title %}</h3>
           {% endif %}
          {% endif %}
         {% endfor %}
-        {% for record in webclass_records|from_course_type:type %}
-            {% include 'webclass/inc/webclass_card.html' %}
+        {% for record in webclass_records %}
+            {% if record.course_type == type %}
+              {% include 'webclass/inc/webclass_card.html' %}
+            {% endif %}
         {% endfor %}
     </tbody>
     </table>
index fa146b2f2825c0321991708316b0ed61c746c4b8..893ad63663132ce75f0af04bfbaf405ea956a2f7 100644 (file)
                 </td>
             </tr>
             {% endif %}
-            {% with type as None %}
-                {% for record in webclass_records|from_course_type:type %}
+            {% for record in webclass_records %}
+                {% if not record.course_type %}
                     {% include 'webclass/inc/webclass_card.html' %}
-                {% endfor %}
-            {% endwith %}
+                {% endif %}
+            {% endfor %}
         </tbody>
     </table>
 </div>