]> git.parisson.com Git - teleforma.git/commitdiff
Get file from crfpa
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 2 Dec 2020 12:55:49 +0000 (13:55 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 2 Dec 2020 12:55:49 +0000 (13:55 +0100)
teleforma/templates/teleforma/inc/media_list.html

index f3521b5044d6109135e151b33d4dd6abce1243c2..c96bbd86b4f81530d33d5761e3a226831d9f2dd4 100644 (file)
@@ -2,35 +2,32 @@
 {% load thumbnail %}
 {% load i18n %}
 
-{% if course.media.all|from_course_type:type|from_period:period %}
-<div class="course_content content_video">
+{% if course.media.all|from_course_type:type %}
+<div class="course_content">
 <div class="course_subtitle">
-    <h3><img src="/static/telemeta/images/item_title.png" width="10px" alt="" /> {% trans title %}</h3>
+    <h3><img src="{{ STATIC_URL }}telemeta/images/item_title.png" width="10px" alt="" /> {% trans "Passed conferences"%}</h3>
 </div>
     <table class="listing" width="100%">
     <tbody>
-        {% for media in course.media.all|from_course_type:type|from_period:period %}
-         {% if media.is_published or user.is_staff and not list_view %}
+        {% for media in course.media.all|from_course_type:type|from_periods:periods %}
+         {% if media.is_published or user.is_staff %}
           {% if media.type == 'webm' %}
             <tr>
             <td {% if forloop.first %}class="border-top"{% endif %} width="230px" style="vertical-align:middle">
-            <a href="{% url teleforma-media-detail period.id media.id %}" title="{% trans "Play" %}">
+            <a href="{% url teleforma-media-detail media.id %}" title="{% trans "Play" %}">
             {% if media.item.related.all %}
              {% for related in media.item.related.all %}
               {% if related.title == "preview" %}
                {% thumbnail related.file "168x96" as im %}
-                <div style="background: no-repeat url('{{ im.url }}') 0 1px; background-size: 100%; background-color: #dfdfdf;">
-                 <img src="/static/teleforma/images/play_168.png" width="100%" alt="{% trans 'Click here' %}" />
+                <div style="background: no-repeat url('{{ im.url|set_host:HOST }}') 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 %}
              {% endfor %}
             {% else %}
-              <div>{% trans 'Click here' %}</div>
+              {% trans 'Click here' %}
             {% endif %}
-            {% comment %}<div>{% trans 'Click here' %}</div>{% endcomment %}
             </a>
             </td>
             <td {% if forloop.first %}class="border-top"{% endif %} width="60%" style="padding-left: 1em;">
@@ -39,7 +36,7 @@
                     <dt>{% trans "Title" %}</dt><dd>{{ media.conference.course.title }}</dd>
                     <dt>{% trans "Session" %}</dt><dd>{{ media.conference.session }}</dd>
                     {% if media.conference.professor %}
-                    <dt>{% trans "Professor" %}</dt><dd>{{ media.conference.professor }}</dd>
+                    <dt>{% trans "Professor" %}</dt><dd><a href="{% url telemeta-profile-detail media.conference.professor.user.username %}" target="_blank">{{ media.conference.professor }}</a></dd>
                     {% endif %}
                     <dt>{% trans "Begin" %}</dt><dd>{{ media.conference.date_begin }}</dd>
                     {% if media.conference.comment %}
             </td>
             <td {% if forloop.first %}class="border-top"{% endif %} width="10%" align="center">
             {% if media.is_published and user.is_staff %}
-             <img src="/static/telemeta/images/ok.png" style="vertical-align:middle" alt="" title="{% trans ' published' %}" />
+             <img src="{{ STATIC_URL }}telemeta/images/ok.png" style="vertical-align:middle" alt="" title="{% trans ' published' %}" />
             {% elif not media.is_published and user.is_staff %}
-             <img src="/static/telemeta/images/delete.png" style="vertical-align:middle" alt="" title="{% trans ' rejected' %}" />
+             <img src="{{ STATIC_URL }}telemeta/images/delete.png" style="vertical-align:middle" alt="" title="{% trans ' rejected' %}" />
             {% endif %}
-            {% if media.item.file and media.is_published or user.is_superuser or user.is_staff %}
-                {% if not "video" in media.mime_type or perms.telemeta.can_play_all_items or request.user_agent.os.family == 'iOS' %}
-                    <a href="{% url teleforma-media-download period.id media.id %}">
-                        <img src="/static/teleforma/images/download_media.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" />
-                    </a>
-                {% endif %}
+            {% if media.item.file and user.is_staff %}
+             <a href="{{ MEDIA_URL|set_host:HOST }}{{ media.item.file }}">
+              <img src="{{ STATIC_URL }}teleforma/images/download_media.png" style="vertical-align:middle" alt="" title="{% trans "Download" %}" />
+             </a>
             {% endif %}
             </td>
             </tr>