{% for to_hash, ref_group in item.get_grouped_references.items %}
{% with ref=ref_group|first %}
{% for r in ref_group %}
{% endfor %}
{{ ref.get_title }}{{ ref_group|length }}x
{% if not ref.is_assigned %}({% trans 'not assigned' %}){% endif %}
{% if user.is_staff %}Admin{% endif %}
{% endwith %}
{% endfor %}
{% else %}
{% trans 'This document does not contain any references.' %}
{% endif %}
{% trans 'Referenced by' %}
{% with cases=referencing_cases|slice:":10" %}
{% include 'cases/table.html' %}
{% endwith %}