{% load django_tables2 %}
{% load apis_relations %}
{% object_relations detail=False as object_relations %}
{% for obj in object_relations %}
  <div class="card card-default mb-2">
    <div class="card-header" role="tab" id="heading{{ forloop.counter }}">
      <div class="card-title">
        <a data-toggle="collapse" href="#collapse{{ forloop.counter }}">{{ obj.0|title }} ({{ obj.1.data|length }})</a>
      </div>
    </div>
    <div id="collapse{{ forloop.counter }}"
         class="card-collapse collapse {% if obj.3 %}in{% endif %} ">
      <div id="tab_{{ obj.2 }}" class="card-body">{% render_table obj.1 %}</div>
    </div>
  </div>
{% endfor %}
