moviewyrm/bookwyrm/templates/book/publisher_info.html

74 lines
2.2 KiB
HTML
Raw Normal View History

2021-04-09 21:57:49 +00:00
{% spaceless %}
2021-03-29 17:21:48 +00:00
{% load i18n %}
2021-04-19 23:30:15 +00:00
{% load humanize %}
2021-04-09 21:57:49 +00:00
2021-10-01 17:08:56 +00:00
{% firstof book.physical_format_detail book.physical_format as format %}
{% firstof book.physical_format book.physical_format_detail as format_property %}
{% with pages=book.pages %}
{% if format or pages %}
2021-04-09 21:57:49 +00:00
{% if format_property %}
<meta itemprop="bookFormat" content="{{ format_property }}">
{% endif %}
2021-04-09 21:57:49 +00:00
{% if pages %}
<meta itemprop="numberOfPages" content="{{ pages }}">
{% endif %}
<p>
2021-10-01 17:08:56 +00:00
{% if format and not pages %}
{% blocktrans %}{{ format }}{% endblocktrans %}
{% elif format and pages %}
{% blocktrans %}{{ format }}, {{ pages }} pages{% endblocktrans %}
{% elif pages %}
{% blocktrans %}{{ pages }} pages{% endblocktrans %}
{% endif %}
2021-03-29 17:21:48 +00:00
</p>
2021-10-01 17:08:56 +00:00
{% endif %}
{% endwith %}
2021-04-09 21:57:49 +00:00
2021-03-29 17:21:48 +00:00
{% if book.languages %}
2021-04-09 21:57:49 +00:00
{% for language in book.languages %}
<meta itemprop="inLanguage" content="{{ language }}">
{% endfor %}
<p>
{% with languages=book.languages|join:", " %}
{% blocktrans %}{{ languages }} language{% endblocktrans %}
{% endwith %}
</p>
2021-03-29 17:21:48 +00:00
{% endif %}
2021-04-09 21:57:49 +00:00
2021-10-01 17:08:56 +00:00
{% with date=book.published_date|naturalday publisher=book.publishers|join:', ' %}
{% if date or book.first_published_date or book.publishers %}
{% if date or book.first_published_date %}
<meta
itemprop="datePublished"
content="{{ book.first_published_date|default:book.published_date|date:'Y-m-d' }}"
>
{% endif %}
2021-03-29 17:21:48 +00:00
<p>
2021-04-09 21:57:49 +00:00
2021-10-01 17:08:56 +00:00
{% comment %}
@todo The publisher property needs to be an Organization or a Person. Well be using Thing which is the more generic ancestor.
@see https://schema.org/Publisher
{% endcomment %}
{% if book.publishers %}
{% for publisher in book.publishers %}
<meta itemprop="publisher" content="{{ publisher }}">
{% endfor %}
{% endif %}
2021-04-09 21:57:49 +00:00
2021-10-01 17:08:56 +00:00
{% if date and publisher %}
{% blocktrans %}Published {{ date }} by {{ publisher }}.{% endblocktrans %}
{% elif date %}
{% blocktrans %}Published {{ date }}{% endblocktrans %}
{% elif publisher %}
{% blocktrans %}Published by {{ publisher }}.{% endblocktrans %}
{% endif %}
2021-03-29 17:21:48 +00:00
</p>
2021-10-01 17:08:56 +00:00
{% endif %}
{% endwith %}
2021-04-09 21:57:49 +00:00
{% endspaceless %}