{% load i18n corpus_extras %} {% spaceless %}
{# display keywords in context if any #} {% with document_highlights=highlighting|dict_item:document.id %} {% if document_highlights.description %} {% for snippet in document_highlights.description %} {{ snippet|safe }} {% if not forloop.last %}[…]{% endif %} {% endfor %} {% else %} {# otherwise, display truncated description #} {{ document.description|truncatewords:25 }} {% endif %} {% endwith %}
{# transcription: keywords in context if any, or excerpt #} {% with document_highlights=highlighting|dict_item:document.id lang=document.language_code lang_script=document.language_script %} {% if document_highlights.transcription or document.transcription %}{% if document.scholarship_count %} {% if document.num_editions %} {% comment %}Translators: number of editions for this document{% endcomment %} {% blocktranslate count counter=document.num_editions trimmed %} 1 Transcription {% plural %} {{ counter }} Transcriptions {% endblocktranslate %} {% endif %} {% if document.num_translations %} {% comment %}Translators: number of translations for this document{% endcomment %} {% blocktranslate count counter=document.num_translations trimmed %} 1 Translation {% plural %} {{ counter }} Translations {% endblocktranslate %} {% endif %} {% if document.num_discussions %} {% comment %}Translators: number of sources that discuss this document{% endcomment %} {% blocktranslate count counter=document.num_discussions trimmed %} 1 Discussion {% plural %} {{ counter }} Discussions {% endblocktranslate %} {% endif %} {% else %} {% translate 'No Scholarship Records' %} {% endif %}