{% load i18n %} {# @description One reference, shown the way a reference list shows it: its title, who made it, what it is, when and where it appeared, and its DOI. Works from the item alone; prefetch item_names__name, item_dates and item_identifiers on a list. #} {# @prop item:text | description:"The literature.models.Item to show." #} {# @prop href:text | description:"Where the title links to. Defaults to the item's catalogue page." #} {# @prop link:boolean | default:True | description:"Link the title and names. Pass :link=\"False\" where the catalogue is not mounted." #} {# @prop level:number | default:3 | description:"Heading level of the title, to fit the page's outline." #} {# @prop abstract:boolean | default:False | description:"Show the start of the abstract under the reference." #} {# @prop class:text | description:"Extra classes added to the outer element." #} {# @slot Cited in the survey. — Extra lines under the reference, such as how a person is credited on it. #}
{% if link %} {{ item.title|default:item.citation_key }} {% else %} {{ item.title|default:item.citation_key }} {% endif %} {% with authors=item.authors editors=item.editors %} {% if authors %} {% for name in authors|slice:":10" %}{% if link %}{{ name }}{% else %}{{ name }}{% endif %}{% if not forloop.last %}, {% endif %}{% endfor %}{% if authors|length > 10 %} {% translate "et al." %}{% endif %} {% elif editors %} {% for name in editors|slice:":10" %}{% if link %}{{ name }}{% else %}{{ name }}{% endif %}{% if not forloop.last %}, {% endif %}{% endfor %}{% if editors|length > 10 %} {% translate "et al." %}{% endif %} {% blocktranslate count counter=editors|length %}(ed.){% plural %}(eds.){% endblocktranslate %} {% endif %} {% endwith %} {{ item.get_type_display }}{% if item.year %} {{ item.year }}{% endif %}{% if item.container_title %} {{ item.container_title }}{% if item.volume %}, {% blocktranslate with volume=item.volume %}vol. {{ volume }}{% endblocktranslate %}{% endif %}{% if item.issue %}, {% blocktranslate with issue=item.issue %}no. {{ issue }}{% endblocktranslate %}{% endif %}{% if item.page %}, {% blocktranslate with page=item.page %}pp. {{ page }}{% endblocktranslate %}{% endif %}{% elif item.publisher %} {{ item.publisher }}{% endif %} {% if item.doi_url %} {{ item.doi_url }} {% endif %} {% if abstract and item.abstract %} {{ item.abstract|truncatewords:30 }} {% endif %} {{ slot }}