{% extends base_template %}
{% block content %}
    <style>
li {
  padding: 1em;
  list-style-type: none;
}
summary {
  list-style-type: none;
}

    </style>
    <div class="container mt-3">
        <ul>
            {% for cluster, entries in groups.items %}
                <li>
                    <a href="{% url "group" %}?group_content_type={{ content_type.app_label }}.{{ content_type.model }}{% for entry in entries %}&ids={{ entry.pk }}{% endfor %}">{{ cluster }}</a>
                    <details>
                        <summary>{{ entries|length }} occurences</summary>
                        {% for entry in entries %}
                            {% url "apis_core:generic:detail" content_type entry.pk as detail_url %}
                            {% if not detail_url %}
                                {% url "apis_core:apis_entities:generic_entities_detail_view" content_type.model entry.pk as detail_url %}
                            {% endif %}
                            {% if detail_url %}<a href="{{ detail_url }}">{{ entry.pk }}</a>,{% endif %}
                        {% endfor %}
                    </details>
                </li>
                <hr />
            {% endfor %}
        </ul>
    </div>
{% endblock content %}
