]> git.parisson.com Git - teleforma.git/commitdiff
add a play button to item preview in media list
authoryomguy <yomguy@parisson.com>
Thu, 9 Aug 2012 23:09:44 +0000 (01:09 +0200)
committeryomguy <yomguy@parisson.com>
Thu, 9 Aug 2012 23:09:44 +0000 (01:09 +0200)
example/settings.py
teleforma/static/teleforma/images/play_168.gif [new file with mode: 0644]
teleforma/static/teleforma/images/play_168.png [new file with mode: 0644]
teleforma/templates/teleforma/inc/media_list.html

index 399eb3dc2740826d2f9036564d013927a65afec8..ba578733448f326beae6c3b8d578d997b33f55e5 100644 (file)
@@ -64,7 +64,7 @@ if not os.path.exists(MEDIA_ROOT):
 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
 # trailing slash if there is a path component (optional in other cases).
 # Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = '/media/'
+MEDIA_URL = 'http://localhost:8040/'
 
 # Absolute path to the directory static files should be collected to.
 # Don't put anything in this directory yourself; store your static files
diff --git a/teleforma/static/teleforma/images/play_168.gif b/teleforma/static/teleforma/images/play_168.gif
new file mode 100644 (file)
index 0000000..4fca0dd
Binary files /dev/null and b/teleforma/static/teleforma/images/play_168.gif differ
diff --git a/teleforma/static/teleforma/images/play_168.png b/teleforma/static/teleforma/images/play_168.png
new file mode 100644 (file)
index 0000000..87568b5
Binary files /dev/null and b/teleforma/static/teleforma/images/play_168.png differ
index c26c953efc09ff8506726ee28541003aab0c8a3e..31e37d1e15a240a194ae58af05f68e3e63c43bfd 100644 (file)
           {% 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 media.id %}" title="{% trans "View" %}">
-                 {% if media.item.related.all %}
-                 {% for related in media.item.related.all %}
-                  {% if related.title == "preview" %}
-                  <img src="{{ MEDIA_URL }}{{ related.file }}" width="100%" alt="{% trans 'Click here' %}" />
-                  {% endif %}
-                 {% endfor %}
-                 {% else %}
-                  {% trans 'Click here' %}
-                 {% endif %}
-                </a>
+            <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" %}
+                <div style="background-image: url('{{ MEDIA_URL }}{{ related.file }}'); background-size: 100%;">
+                 <img src="{{ STATIC_URL }}teleforma/images/play_168.png" width="100%" alt="{% trans 'Click here' %}" />
+                </div>
+              {% endif %}
+             {% endfor %}
+            {% else %}
+              {% trans 'Click here' %}
+            {% endif %}
+            </a>
             </td>
             <td {% if forloop.first %}class="border-top"{% endif %} width="60%" style="padding-left: 1em;">
                 <div>