forked from mirrors/bookwyrm
- Have an explicit contextual class on `cover-container`. - Use more flexible, consistent and searchable variable name for passing classes to covers. - Consistently use `'…'` with django variables. - Give the option to not hide covers to screen readers. - consitently give a title to the cover container if `alt_text` exists. - [lists] Remove `.content` which is applying too extensive default styles.
49 lines
1 KiB
HTML
49 lines
1 KiB
HTML
{% spaceless %}
|
|
|
|
{% load bookwyrm_tags %}
|
|
{% load i18n %}
|
|
|
|
<figure
|
|
class="
|
|
cover-container
|
|
is-clipped
|
|
is-flex
|
|
is-align-items-center
|
|
{{ cover_class }}
|
|
|
|
{% if not book.cover %}
|
|
no-cover
|
|
{% endif %}
|
|
"
|
|
|
|
{% if aria != "show" %}
|
|
aria-hidden="true"
|
|
{% endif %}
|
|
|
|
{% if book.alt_text %}
|
|
title="{{ book.alt_text }}"
|
|
{% endif %}
|
|
>
|
|
<img
|
|
class="book-cover"
|
|
|
|
{% if book.cover %}
|
|
src="{% if img_path is None %}/images/{% else %}{{ img_path }}{% endif %}{{ book.cover }}"
|
|
itemprop="thumbnailUrl"
|
|
|
|
{% if book.alt_text %}
|
|
alt="{{ 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>
|
|
{% endif %}
|
|
</figure>
|
|
{% endspaceless %}
|