generate covers in migration
[wolnelektury.git] / wolnelektury / templates / catalogue / book_mini_box.html
index 43ca2a5..6728be8 100755 (executable)
@@ -2,13 +2,15 @@
 {% load thumbnail %}
 <div class="book-mini-box">
     <a href="{{ book.get_absolute_url }}">
-        <img src="
-            {% thumbnail book.cover "216x288" as thumb %}
-                {{ thumb.url }}
-            {% empty %}
-                {{ book.cover.url }}
-            {% endthumbnail %}
-        " alt="{% trans "Book cover" %}" />
+        {% if book.cover %}
+            <img src="
+                {% thumbnail book.cover "216x288" as thumb %}
+                    {{ thumb.url }}
+                {% empty %}
+                    {{ book.cover.url }}
+                {% endthumbnail %}
+            " alt="{% trans "Book cover" %}" />
+        {% endif %}
         {% for author in authors %}
             <div class="mono author">{{ author }}</div>
             {{ book.title }}