kingsdigitallab / django-kdl-wagtail

A collection of Wagtail components used across several KDL projects
MIT License
4 stars 0 forks source link

Display pagination only when needed #6

Closed ginestra closed 5 years ago

ginestra commented 5 years ago

Description

It would be good to display the pagination (includes/pagination.html) only when there is more than one page available (i.e. the list of items exceeds the one set in settings).

What I Did

The existing template could be wrapped in

{% if items.paginator.num_pages > 1 %}
...
{% endif %}

See: https://github.com/kingsdigitallab/egomedia-django/blob/design/templates/kdl_wagtail_core/includes/pagination.html

jmiguelv commented 5 years ago

Implemented by d77f10e.