moviewyrm/bookwyrm/templates/snippets/book_cover.html

52 lines
1.1 KiB
HTML
Raw Normal View History

2021-04-09 21:57:49 +00:00
{% spaceless %}
2020-12-13 02:25:04 +00:00
{% load bookwyrm_tags %}
2021-04-09 21:57:49 +00:00
{% load i18n %}
<figure
class="
cover-container
is-clipped
is-flex
is-align-items-center
{% if not book.cover %}
no-cover
{% endif %}
{% if size %}
is-{{ size }}
{% endif %}
{% if container_class %}
{{ container_class }}
{% endif %}
"
aria-hidden="true"
>
<img
class="book-cover"
{% if book.cover %}
src="{% if img_path is None %}/images/{% else %}{{ img_path }}{% endif %}{{ book.cover }}"
2021-04-09 21:57:49 +00:00
itemprop="thumbnailUrl"
{% if book.alt_text %}
alt="{{ book.alt_text }}"
title="{{ book.alt_text }}"
{% endif %}
{% else %}
src="/static/images/no_cover.jpg"
alt="{% trans "No cover" %}"
{% endif %}
>
{% if not book.cover and book.alt_text %}
<figcaption class="cover_caption">
<p>{{ book.alt_text }}</p>
</figcaption>
2021-04-09 21:57:49 +00:00
{% endif %}
</figure>
2021-04-09 21:57:49 +00:00
{% endspaceless %}