2021-04-09 21:57:49 +00:00
|
|
|
{% spaceless %}
|
|
|
|
|
|
|
|
{% load i18n %}
|
2021-06-07 17:52:25 +00:00
|
|
|
{% load static %}
|
2021-05-24 14:16:09 +00:00
|
|
|
{% load imagekit %}
|
2021-08-03 15:45:52 +00:00
|
|
|
{% load utilities %}
|
2021-04-09 21:57:49 +00:00
|
|
|
|
2021-05-24 14:16:09 +00:00
|
|
|
{% if book.cover %}
|
|
|
|
<picture class="cover-container {{ cover_class }}">
|
2021-06-06 19:12:21 +00:00
|
|
|
{% if external_path %}
|
|
|
|
<img
|
|
|
|
class="book-cover"
|
|
|
|
src="{{ book.cover }}"
|
|
|
|
itemprop="thumbnailUrl"
|
|
|
|
alt="{{ book.alt_text|default:'' }}"
|
|
|
|
>
|
|
|
|
{% else %}
|
2021-04-24 10:48:55 +00:00
|
|
|
|
2021-08-04 09:42:18 +00:00
|
|
|
{% if thumbnail_generation_enabled %}
|
2021-06-07 17:52:25 +00:00
|
|
|
|
2021-08-03 16:03:34 +00:00
|
|
|
{% if size_mobile %}
|
2021-06-07 17:52:25 +00:00
|
|
|
<source
|
|
|
|
media="(max-width: 768px)"
|
|
|
|
type="image/webp"
|
2021-08-03 16:03:34 +00:00
|
|
|
srcset="{% get_book_cover_thumbnail book=book size=size_mobile ext='webp' %}"
|
2021-06-07 17:52:25 +00:00
|
|
|
/>
|
|
|
|
<source
|
|
|
|
media="(max-width: 768px)"
|
|
|
|
type="image/jpg"
|
2021-08-03 16:03:34 +00:00
|
|
|
srcset="{% get_book_cover_thumbnail book=book size=size_mobile ext='jpg' %}"
|
2021-06-07 17:52:25 +00:00
|
|
|
/>
|
|
|
|
{% endif %}
|
|
|
|
|
2021-08-03 16:03:34 +00:00
|
|
|
<source
|
|
|
|
type="image/webp"
|
|
|
|
srcset="{% get_book_cover_thumbnail book=book size=size ext='webp' %}"
|
|
|
|
/>
|
|
|
|
<source
|
|
|
|
type="image/jpg"
|
|
|
|
srcset="{% get_book_cover_thumbnail book=book size=size ext='jpg' %}"
|
|
|
|
/>
|
2021-04-24 10:48:55 +00:00
|
|
|
|
2021-06-06 19:12:21 +00:00
|
|
|
{% endif %}
|
2021-04-24 10:48:55 +00:00
|
|
|
|
2021-06-06 19:12:21 +00:00
|
|
|
<img
|
2021-08-03 15:45:52 +00:00
|
|
|
alt="{{ book.alt_text|default:'' }}"
|
2021-06-06 19:12:21 +00:00
|
|
|
class="book-cover"
|
|
|
|
itemprop="thumbnailUrl"
|
2021-08-02 19:43:59 +00:00
|
|
|
src="{% if img_path is None %}{% get_media_prefix %}{% else %}{{ img_path }}{% endif %}{{ book.cover }}"
|
2021-06-06 19:12:21 +00:00
|
|
|
>
|
2021-08-02 19:43:59 +00:00
|
|
|
|
2021-06-06 19:12:21 +00:00
|
|
|
{% endif %}
|
2021-05-24 14:16:09 +00:00
|
|
|
</picture>
|
|
|
|
{% endif %}
|
2021-04-24 10:48:55 +00:00
|
|
|
|
2021-05-24 14:16:09 +00:00
|
|
|
{% if not book.cover and book.alt_text %}
|
|
|
|
<figure class="cover-container no-cover {{ cover_class }}">
|
|
|
|
<img
|
|
|
|
class="book-cover"
|
2021-06-07 17:52:25 +00:00
|
|
|
src="{% static "images/no_cover.jpg" %}"
|
2021-04-24 10:48:55 +00:00
|
|
|
alt="{% trans "No cover" %}"
|
2021-05-24 14:16:09 +00:00
|
|
|
>
|
2021-05-24 14:16:33 +00:00
|
|
|
<figcaption class="cover-caption">
|
2021-04-24 10:48:55 +00:00
|
|
|
<p>{{ book.alt_text }}</p>
|
|
|
|
</figcaption>
|
2021-05-24 14:16:09 +00:00
|
|
|
</figure>
|
|
|
|
{% endif %}
|
2021-04-09 21:57:49 +00:00
|
|
|
{% endspaceless %}
|