{% comment %} The books-list-item template is used to display a book as part of a list. This template is used on multi-item search, library list/search page, the tab section of the library details page. The template allows for the following parameters: * `book` - the instance of the book (properties of the instance are referenced as "book.properties" within the template) * `href` - the link to the details page for the instance. Will render a span instead of a link if not defined * `shorten` - this will hide the badge, image, excerpt, and citation sections of the template * `thumbnail_size` - determines the book image thumbnail size; should be one of `thumbnail` or `smthumb` * `` {% endcomment %} {% load static %}
{% if book.is_annotated %} contains annotations {% endif %} {% if not shorten %}
{% with book.digital_edition|yesno:"a,span" as tag %} <{{tag}} class="img item__image__link"{% if tag == "a" %} href="{{ href }}"{% endif %}> {% if book.digital_edition %} View bibliographic details for {{ book.display_title }} {% else %} Edition not digitized by Princeton University Libraries {% endif %} {% endwith %}
{% endif %}
{{ book.item_type }}

{% with book.digital_edition|yesno:"a,span" as tag %} <{{tag}}{% if tag == 'a' %} class="item__link" href="{{ href }}"{% endif %}>{{ book.display_title }} {% endwith %}

{% url 'books:list' as library_url %} {# only display first two authors; display et, al if there are more #} {# solr result #} {% if book.author_firstname_last %} {{ book.author_firstname_last.0}}{% if book.author_firstname_last|length > 1 %}, {{ book.author_firstname_last.1}}{% endif %}{% if book.author_firstname_last|length > 2 %}, et al.{% endif %} {% endif %} {# database result #} {% for author in book.work.authors.all|slice:":2" %} {{ author.firstname_last }}{% if not forloop.last %}, {% endif %}{% if forloop.last and book.work.authors.count > 2 %}, et al.{% endif %} {% endfor %}

{% if book.year %}

{{ book.year }}{% if book.copy %} - {{ book.copy }}{% endif %}

{% endif %}

{{ book.location|default:'' }}

---

{% if book.cited_in %}

Cited in: {% for cited in book.cited_in.all %} {% if not forloop.last %} {{ cited.work.primary_title }};  {% else %} {{ author.work.primary_title }} {% endif %} {% endfor %}

{% endif %}