{% load pagination_tags %}
{% load i18n %}
<div class="tab-pane active list paginate-contents" id="all">
  <p class="search-count">Total: {{ total }}</p>
{% if object_list|length > 0 %}
{% autopaginate object_list 4 %}
{% for object in object_list %}

  {% if object.o.class_name == 'Layer' %}
    {% with object.o as layer %}
      {% include "layers/_layer_list_item.html" %}
    {% endwith %}
  {% elif object.o.class_name == 'Map' %}
    {% with object.o as map %}
      {% include "maps/_map_list_item.html" %}
    {% endwith %}
  {% elif object.o.class_name == 'Document' %}
    {% with object.o as document %}
      {% include "documents/_document_list_item.html" %}
    {% endwith %}
  {% elif object.o.class_name == 'Profile' %}
    {% with object as profile %}
      {% include "people/_profile_list_item.html" %}
    {% endwith %}
  {% elif object.o.class_name == 'Group' %}
    {% with object as group %}
    {% if GROUPS_APP %}
      {% comment %}
        This is a bit strange, but required as the include is processed before the if
        http://stackoverflow.com/questions/10950275/conditional-include-tag-in-django?answertab=active#tab-top
      {% endcomment %}
      {% with "groups/_group_list_item.html" as groups_template %}
      {% include groups_template %}
      {% endwith %}
    {% endif %}
    {% endwith %}
  {% endif %}
{% endfor %}
{% else %}
  <p class="search-count">{% trans "No data found" %}</p>
{% endif %}
</div>
{% if object_list|length > 0 %}
  {% paginate %}
{% endif %}
