Funding: Using thumbnail for the cover image on the offer detail page
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Wed, 29 May 2013 10:13:53 +0000 (12:13 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 3 Jun 2013 08:03:42 +0000 (10:03 +0200)
apps/funding/templates/funding/offer_detail.html

index 80d0965..905e03b 100755 (executable)
@@ -4,6 +4,7 @@
 {% load funding_tags %}
 {% load pagination_tags %}
 {% load fnp_share %}
 {% load funding_tags %}
 {% load pagination_tags %}
 {% load fnp_share %}
+{% load thumbnail %}
 
 
 {% block titleextra %}{{ object }}{% endblock %}
 
 
 {% block titleextra %}{{ object }}{% endblock %}
 <div class="white-box">
     <div class="funding-details-intro">
         {% if object.cover %}
 <div class="white-box">
     <div class="funding-details-intro">
         {% if object.cover %}
-            <img src="{{ object.cover.url }}" class="funding-cover"/>
+            <img src="
+                {% thumbnail object.cover "139x193" as thumb %}
+                    {{ thumb.url }}
+                {% empty %}
+                    {{ object.cover.url }}
+                {% endthumbnail %}
+            " alt="Cover" class="funding-cover" />
         {% endif %}
         <div class="normal-text">
         <h3>{% trans "Help free the book!" %}</h3>
         {% endif %}
         <div class="normal-text">
         <h3>{% trans "Help free the book!" %}</h3>