2021-04-09 21:57:49 +00:00
|
|
|
|
{% spaceless %}
|
2021-08-04 19:36:54 +00:00
|
|
|
|
{% load i18n %}
|
|
|
|
|
{% load humanize %}
|
2021-04-09 21:57:49 +00:00
|
|
|
|
{% comment %}
|
2021-04-09 22:07:01 +00:00
|
|
|
|
@todo The author property needs to be an Organization or a Person. We’ll be using Thing which is the more generic ancestor.
|
2021-04-09 21:57:49 +00:00
|
|
|
|
@see https://schema.org/Author
|
|
|
|
|
{% endcomment %}
|
2021-08-04 19:36:54 +00:00
|
|
|
|
{% firstof limit None as limit %}
|
|
|
|
|
{% with subtraction_value='-'|add:limit %}
|
|
|
|
|
{% with remainder_count=book.authors.count|add:subtraction_value %}
|
|
|
|
|
{% with remainder_count_display=remainder_count|intcomma %}
|
|
|
|
|
|
|
|
|
|
{% for author in book.authors.all|slice:limit %}
|
2021-04-09 21:57:49 +00:00
|
|
|
|
<a
|
2021-05-04 16:34:16 +00:00
|
|
|
|
href="{{ author.local_path }}"
|
2021-04-09 21:57:49 +00:00
|
|
|
|
class="author"
|
|
|
|
|
itemprop="author"
|
|
|
|
|
itemscope
|
|
|
|
|
itemtype="https://schema.org/Thing"
|
|
|
|
|
><span
|
|
|
|
|
itemprop="name"
|
2021-08-04 19:36:54 +00:00
|
|
|
|
>{{ author.name }}<span></a>{% if not forloop.last %}, {% elif remainder_count > 0 %}, {% blocktrans trimmed count counter=remainder_count %}
|
|
|
|
|
and {{ remainder_count_display }} other
|
|
|
|
|
{% plural %}
|
|
|
|
|
and {{ remainder_count_display }} others
|
|
|
|
|
{% endblocktrans %}{% endif %}
|
2021-04-09 21:57:49 +00:00
|
|
|
|
{% endfor %}
|
2021-08-04 19:36:54 +00:00
|
|
|
|
|
|
|
|
|
{% endwith %}
|
|
|
|
|
{% endwith %}
|
|
|
|
|
{% endwith %}
|
2021-04-09 21:57:49 +00:00
|
|
|
|
{% endspaceless %}
|