mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-25 19:17:22 +00:00
dd30ac4fbd
Merge remote-tracking branch 'cover/thumbnails' into development # Conflicts: # cps/admin.py # cps/templates/layout.html # cps/ub.py # cps/web.py Update join for sqlalchemy 1.4
14 lines
588 B
HTML
14 lines
588 B
HTML
{% macro book_cover_image(book, thumbnails) -%}
|
|
{%- set book_title = book.title if book.title else book.name -%}
|
|
{% set srcset = thumbnails|get_book_thumbnail_srcset if thumbnails|length else '' %}
|
|
{%- if srcset|length -%}
|
|
<img
|
|
srcset="{{ srcset }}"
|
|
src="{{ url_for('web.get_cached_cover', cache_id=book|book_cover_cache_id) }}"
|
|
alt="{{ book_title }}"
|
|
/>
|
|
{%- else -%}
|
|
<img src="{{ url_for('web.get_cached_cover', cache_id=book|book_cover_cache_id) }}" alt="{{ book_title }}" />
|
|
{%- endif -%}
|
|
{%- endmacro %}
|