]> git.parisson.com Git - teleforma.git/commitdiff
Notelemeta fixes
authorYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 4 Jan 2022 12:11:28 +0000 (13:11 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Tue, 4 Jan 2022 12:11:28 +0000 (13:11 +0100)
teleforma/templates/teleforma/inc/media_package_list.html
teleforma/templates/teleforma/inc/media_step.html
teleforma/templates/teleforma/inc/steps.html
teleforma/templates/teleforma/seminar_media_audio.html
teleforma/templatetags/teleforma_tags.py
teleforma/views/core.py

index 649a51b25cb6e444407d751e78581a612ac955bf..14c9d9a12a8f7ebfc0872e78e23ad8581e554713 100644 (file)
@@ -9,18 +9,16 @@
             <tr>
             <td {% if forloop.first %}class="border-top"{% endif %} width="230px" style="vertical-align:middle">
             <a href="{% url 'teleforma-media-video' seminar.id media.id %}" title="{% trans "Play" %}">
-            {% with media.item.related.all|preview as related %}
-             {% if related %}
+             {% if im.poster_file %}
                {% thumbnail related.file "168x98" as im %}
-                <div style="background: no-repeat url('{{ im.url }}') 0 1px; background-size: 100%; background-color: #dfdfdf;">
+                <div style="background: no-repeat url('{{ im.poster_file }}') 0 1px; background-size: 100%; background-color: #dfdfdf;">
                  <img src="{{ STATIC_URL }}teleforma/images/play_168.png" width="100%" alt="{% trans 'Click here' %}" />
                 </div>
                {% endthumbnail %}
              {% else %}
               {% trans 'Click here' %}
              {% endif %}
-            {% endwith %}
-            </a>
+             </a>
             </td>
             <td {% if forloop.first %}class="border-top"{% endif %} width="60%" style="padding-left: 1em;">
                 <div>
@@ -35,7 +33,7 @@
                     {% if media.description %}
                     <dt>{% trans "Description" %}</dt><dd>{{ media.description }}</dd>
                     {% endif %}
-                    <dt>{% trans "Duration" %}</dt><dd>{{ media.item.approx_duration|fancy_duration }}</dd>
+                    <dt>{% trans "Duration" %}</dt><dd>{{ media.approx_duration|fancy_duration }}</dd>
                     </dl>
                  </div>
             </td>
index 13defac41a21930ba8901bf78b331b49ef655741..7e471534422e8f31eccf305d3cf174fc7cff68ce 100644 (file)
@@ -9,7 +9,7 @@
             <tr>
             <td {% if forloop.first %}class="border-top"{% endif %} width="230px" style="vertical-align:middle">
               <a href="{% url 'teleforma-media-video' seminar.id media.id %}" target="_blank" title="{% trans "Play" %}">
-              <img src="{{ STATIC_URL }}/teleforma/images/tool-animator.png" style="vertical-align:middle" alt="" /> {{ media.item.title }}{% if user in media.readers.all %} <img src="{{ STATIC_URL }}teleforma/images/ok.png" style="vertical-align:middle" alt="" title="{% trans ' viewed' %}" />{% endif %}
+              <img src="{{ STATIC_URL }}/teleforma/images/tool-animator.png" style="vertical-align:middle" alt="" /> {{ media.title }}{% if user in media.readers.all %} <img src="{{ STATIC_URL }}teleforma/images/ok.png" style="vertical-align:middle" alt="" title="{% trans ' viewed' %}" />{% endif %}
             </a>
           </td>
           </tr>
index 7aae6781f1ecc16ef8eceb390026391f2f9690b7..bee8e3d53b5289a4a3126cf6a80c0924ed22bd17 100644 (file)
 {% endwith %}
 {% endif %}
 
-{% if seminar|validated:user %}
-<div class="course_subtitle">
-  <h4><img src="{{ STATIC_URL }}/teleforma/images/item_title.png" width="10px" alt="" /> {% trans "Step" %} 7</h4>
-</div>
-{% include "teleforma/inc/testimonial_step.html" %}
-{% endif %}
-
 {% endif %}
\ No newline at end of file
index f47f3e27207eae84be2738645cf35ebe47efb391..0f5aef92ac877c30681f8326d54e517784a808ad 100644 (file)
 {% else %}
 <div class="media">
 
+{% if media.poster_file %}
 <div style="margin-top:1em;">
-{% if media.item.related.all %}
- {% for related in media.item.related.all %}
-  {% if related.title == "preview" %}
-   <img src="{{ MEDIA_URL }}{{ related.file }}" width="300px" alt="" />
-  {% endif %}
- {% endfor %}
-{% else %}
- snapshot
-{% endif %}
+   <img src="{{ MEDIA_URL }}{{ media.poster_file }}" width="300px" alt="" />
 </div>
+{% endif %}
 
 <div class="audio">
 <audio id="audio_1" controls preload="auto">
index 1bbb91cd4b114f9549c7f532931808a30400f0da..84414bc090e64a24bd231d343923d773aebbdff3 100644 (file)
@@ -290,14 +290,6 @@ def hours(time):
 def point(time):
     return str(time)
 
-@register.filter
-def preview(related):
-    media = related.filter(title='preview')
-    if media:
-        return media[0]
-    else:
-        return None
-
 @register.filter
 def fancy_duration(duration):
     time = ''
index 8f0ca2f52d09f45dc2e67f2a499a88264177305c..c5f61e23efef15ee1b6b8567c8110cd0a9a5e0a2 100644 (file)
@@ -248,12 +248,6 @@ class CourseView(DetailView):
         context['courses'] = courses
         context['all_courses'] = all_courses
         context['notes'] = course.notes.all().filter(author=self.request.user)
-        content_type = ContentType.objects.get(app_label="teleforma", model="course")
-        if settings.TELEFORMA_GLOBAL_TWEETER:
-            context['room'] = get_room(name='site')
-        else:
-            context['room'] = get_room(name=course.title, content_type=content_type,
-                                   id=course.id)
         context['doc_types'] = DocumentType.objects.all()
         context['periods'] = get_periods(self.request.user)
         return context
@@ -317,12 +311,6 @@ class MediaView(DetailView):
         context['course'] = media.course
         context['type'] = media.course_type
         context['notes'] = media.notes.all().filter(author=self.request.user)
-        content_type = ContentType.objects.get(app_label="teleforma", model="media")
-        if settings.TELEFORMA_GLOBAL_TWEETER:
-            context['room'] = get_room(name='site')
-        else:
-            context['room'] = get_room(name=media.item.title, content_type=content_type,
-                                   id=media.id)
         context['periods'] = get_periods(self.request.user)
         return context
 
@@ -456,12 +444,6 @@ class DocumentView(DetailView):
         document = self.get_object()
         context['course'] = document.course
         context['notes'] = document.notes.all().filter(author=self.request.user)
-        content_type = ContentType.objects.get(app_label="teleforma", model="document")
-        if settings.TELEFORMA_GLOBAL_TWEETER:
-            context['room'] = get_room(name='site')
-        else:
-            context['room'] = get_room(name=document.title, content_type=content_type,
-                                   id=document.id)
         access = get_seminar_doc_access(document, seminars)
         if not access:
             context['access_error'] = access_error
@@ -554,7 +536,6 @@ class ConferenceView(DetailView):
                 conference.set_as_read(self.request.user)
             
         else:
-            content_type = ContentType.objects.get(app_label="teleforma", model="conference")
             context['livestreams'] = conference.livestream.all()
             context['host'] = get_host(self.request)
             all_courses = get_courses(self.request.user)
@@ -570,11 +551,6 @@ class ConferenceView(DetailView):
         context['course'] = conference.course
         context['periods'] = get_periods(self.request.user)
         context['conferences'] = all_conferences(self.request)
-        if settings.TELEFORMA_GLOBAL_TWEETER:
-            context['room'] = get_room(name='site')
-        else:
-            context['room'] = get_room(name=conference.course.title, content_type=content_type,
-                                       id=conference.id)
         return context
 
     @jsonrpc_method('teleforma.stop_conference')