diff --git a/apis_core/apis_metainfo/templates/generic_list.html b/apis_core/apis_metainfo/templates/generic_list.html index 89cc3a2e0..aa8e65c57 100644 --- a/apis_core/apis_metainfo/templates/generic_list.html +++ b/apis_core/apis_metainfo/templates/generic_list.html @@ -5,6 +5,7 @@ {% load i18n %} {% load crispy_forms_field %} {% load crispy_forms_tags %} +{% load apiscore %} {% block title %}Browse {{ class_name }}{% endblock %} @@ -255,48 +256,59 @@

{{ data.title }}

{% block pagination.allpages %} -
- {% with table.page.object_list|length as count %}

Page total: {{ count }}

{% endwith %} -
- - {% endif %} - - {% endblock pagination.allpages %} + - {% if 'entities' in APPS %}{% endif %} diff --git a/apis_core/core/templatetags/apiscore.py b/apis_core/core/templatetags/apiscore.py index a171d68a5..e001c1a30 100644 --- a/apis_core/core/templatetags/apiscore.py +++ b/apis_core/core/templatetags/apiscore.py @@ -8,3 +8,8 @@ @register.simple_tag def shared_url(): return getattr(settings, "SHARED_URL", "/static/") + + +@register.simple_tag +def page_range(paginator, number): + return paginator.get_elided_page_range(number=number)