diff --git a/kjvstudy_org/templates/chapter.html b/kjvstudy_org/templates/chapter.html index 0381c59..90c269c 100644 --- a/kjvstudy_org/templates/chapter.html +++ b/kjvstudy_org/templates/chapter.html @@ -466,9 +466,10 @@ document.body.dataset.resourceReader = 'false'; {% if commentary.cross_reference_groups %} {% set total_refs = commentary.cross_reference_groups | sum(attribute='refs', start=[]) | length %} {% set preview_count = [commentary.cross_reference_groups|length, 3]|min %} + {% set hidden_count = total_refs - preview_count %} - {% for group in commentary.cross_reference_groups[:3] %}{{ group.description }}: {{ group.refs[0].text }}{% if group.refs|length > 1 %}; {% for ref in group.refs[1:] %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% endif %}{% if not loop.last %}. {% endif %}{% endfor %}{% if commentary.cross_reference_groups|length > 3 %}. {% for group in commentary.cross_reference_groups[3:] %}{{ group.description }}: {% for ref in group.refs %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% if not loop.last %}. {% endif %}{% endfor %}{% endif %}{% if total_refs > preview_count %} +{{ total_refs - preview_count }}{% endif %} + {% for group in commentary.cross_reference_groups[:3] %}{{ group.description }}: {{ group.refs[0].text }}{% if group.refs|length > 1 %}{% if hidden_count >= 3 %}; {% for ref in group.refs[1:] %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% else %}; {% for ref in group.refs[1:] %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% endif %}{% endif %}{% if not loop.last %}. {% endif %}{% endfor %}{% if commentary.cross_reference_groups|length > 3 %}{% if hidden_count >= 3 %}. {% for group in commentary.cross_reference_groups[3:] %}{{ group.description }}: {% for ref in group.refs %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% if not loop.last %}. {% endif %}{% endfor %}{% else %}. {% for group in commentary.cross_reference_groups[3:] %}{{ group.description }}: {% for ref in group.refs %}{{ ref.text }}{% if not loop.last %}; {% endif %}{% endfor %}{% if not loop.last %}. {% endif %}{% endfor %}{% endif %}{% endif %}{% if hidden_count >= 3 %} +{{ hidden_count }}{% endif %} {% endif %} {% endif %}