Snippet for book covers

Fixes #20
This commit is contained in:
Mouse Reeve 2020-02-18 23:03:04 -08:00
parent d77f1b9882
commit bca0a1f32c
3 changed files with 3 additions and 2 deletions

View file

@ -1,5 +1,5 @@
{% load fr_display %}
<img class="book-cover {{ size }}" src="{% if book.cover %}/images/{{ book.cover }}{% else %}/static/images/no_cover.jpg{% endif %}">
{% include 'snippets/book_cover.html' with book=book %}
<p class="title">
<a href="/book/{{ book.openlibrary_key }}">{{ book.data.title }}</a>
</p>

View file

@ -0,0 +1 @@
<img class="book-cover {{ size }}" src="{% if book.cover %}/images/{{ book.cover }}{% else %}/static/images/no_cover.jpg{% endif %}">

View file

@ -89,7 +89,7 @@
{% for book in shelf.books.all %}
<tr class="book-preview">
<td>
<img src="/images/{{ book.cover }}" class="book-cover small">
{% include 'snippets/book_cover.html' with book=book %}
</td>
<td>
<a href="/book/{{ book.openlibrary_key }}">{{ book.data.title }}</a>