No cover state for books

This commit is contained in:
Mouse Reeve
2020-03-15 15:41:23 -07:00
parent 3e0fc9a590
commit a57d43b0b4
3 changed files with 30 additions and 2 deletions

View File

@ -1 +1,11 @@
<img class="book-cover {{ size }}" src="{% if book.cover %}/images/{{ book.cover }}{% else %}/static/images/no_cover.jpg{% endif %}">
{% if book.cover %}
<img class="book-cover {{ size }}" src="/images/{{ book.cover }}">
{% else %}
<div class="no-cover book-cover">
<img class="book-cover {{ size }}" src="/static/images/no_cover.jpg">
<div>
<p class="title">{{ book.title }}</p>
<p>{{ book.authors.first.name }}</p>
</div>
</div>
{% endif %}