moviewyrm/bookwyrm/templates/snippets/authors.html

33 lines
1 KiB
HTML
Raw Normal View History

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 %}
@todo The author property needs to be an Organization or a Person. Well 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-12-22 13:53:34 +00:00
class="author {{ link_class }}"
2021-04-09 21:57:49 +00:00
itemprop="author"
itemscope
itemtype="https://schema.org/Thing"
><span
itemprop="name"
2021-08-07 22:40:50 +00:00
>{{ author.name }}</span></a>{% if not forloop.last %}, {% elif remainder_count > 0 %}, {% blocktrans trimmed count counter=remainder_count %}
2021-08-04 19:36:54 +00:00
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 %}