]> git.parisson.com Git - telemeta.git/commitdiff
add thumbnails to items and collections 1.4.3
authoryomguy <yomguy@parisson.com>
Wed, 21 Mar 2012 16:31:43 +0000 (17:31 +0100)
committeryomguy <yomguy@parisson.com>
Wed, 21 Mar 2012 16:31:43 +0000 (17:31 +0100)
telemeta/templates/telemeta/inc/collection_related.html
telemeta/templates/telemeta/inc/mediaitem_related.html

index 9f73569688866ce5831c2661745a8dba6da84441..1f1f2d38a56909ea2c317efbf52aecd8f9fc812f 100644 (file)
@@ -1,5 +1,6 @@
 {% load i18n %}
 {% load telemeta_utils %}
+{% load thumbnail %}
 
         <div>
             <h4><a href="#">{% trans "Related media" %}</a></h4>
                             </dl>
                             </td>
 
-                            <td style="padding-bottom: 1em;">{% if media.is_image %}
-                                  {% if media.url %}
-                                   <a href="{{ media.url }}">
-                                   <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
-                                  {% else %}
-                                   <a href="{% url telemeta-collection-related collection.public_id media.id %}">
-                                   <img src="{% url telemeta-collection-related collection.public_id media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
-                                   {% endif %}
+                            <td style="padding-bottom: 1em;">
+                                {% if media.is_image %}
+                                {% if media.file %}
+                                <a href="{% url telemeta-collection-related collection.public_id media.id %}">
+                                {% thumbnail media.file "420" as im %}
+                                <img src="{{ im.url }}" style="max-width: 420px; max-height: 200px;" />
+                                {% endthumbnail %}
+                                </a>
+                                {% else %}
+                                <a href="{{ media.url }}">
+                                {% thumbnail media.url "420" as im %}
+                                <img src="{{ im.url }}" style="max-width: 420px; max-height: 200px;" />
+                                {% endthumbnail %}
+                                </a>
+                                {% endif %}
                                 {% else %}
                                 {% if media.url %}
                                  {% if "youtu" in media.url %}
index 458c266986790f6fc209272ff53724829b7a07f5..e771f6d29f0e111fe56d70c2e5cae88a008df278 100644 (file)
@@ -1,5 +1,6 @@
 {% load i18n %}
 {% load telemeta_utils %}
+{% load thumbnail %}
 
         <div>
             <h4><a href="#">{% trans "Related media" %}</a></h4>
                             </dl>
                             </td>
 
-                            <td style="padding-bottom: 1em;">{% if media.is_image %}
-                                  {% if media.url %}
-                                   <a href="{{ media.url }}">
-                                   <img src="{{ media.url }}" style="max-width: 420px; max-height: 200px;" /></a>
-                                  {% else %}
-                                   <a href="{% url telemeta-item-related item.public_id media.id %}">
-                                   <img src="{% url telemeta-item-related item.public_id media.id %}" style="max-width: 420px; max-height: 200px;" /></a>
-                                   {% endif %}
+                            <td style="padding-bottom: 1em;">
+                                {% if media.is_image %}
+                                {% if media.file %}
+                                <a href="{% url telemeta-item-related item.public_id media.id %}">
+                                {% thumbnail media.file "420" as im %}
+                                <img src="{{ im.url }}" style="max-width: 420px; max-height: 200px;" />
+                                {% endthumbnail %}
+                                </a>
+                                {% else %}
+                                <a href="{{ media.url }}">
+                                {% thumbnail media.url "420" as im %}
+                                <img src="{{ im.url }}" style="max-width: 420px; max-height: 200px;" />
+                                {% endthumbnail %}
+                                </a>
+                                {% endif %}
                                 {% else %}
                                 {% if media.url %}
                                  {% if "youtu" in media.url %}