diff --git a/src/postorius/templates/postorius/lists/bans.html b/src/postorius/templates/postorius/lists/bans.html index b3e6d9c..89a1d91 100644 --- a/src/postorius/templates/postorius/lists/bans.html +++ b/src/postorius/templates/postorius/lists/bans.html @@ -2,6 +2,7 @@ {% load i18n %} {% load bootstrap_tags %} {% load nav_helpers %} +{% load pagination %} {% block head_title %} {% trans 'Banned addresses' %} | {{ list.fqdn_listname }} - {{ block.super }} @@ -32,12 +33,10 @@

{% trans 'Currently banned addresses' %}

- {% with list_bans=list.bans %} - - {% if list_bans|length > 0 %} + {% if banned_addresses|length > 0 %} - {% for ban in list.bans %} + {% for ban in banned_addresses %}
{{ ban.email }} @@ -54,10 +53,9 @@ {% endfor %}
+ {% paginator banned_addresses %} {% else %}

{% trans 'No addresses are currently banned.' %}

{% endif %} - {% endwith %} - {% endblock %} diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py index 3094753..faf79e4 100644 --- a/src/postorius/views/list.py +++ b/src/postorius/views/list.py @@ -830,8 +830,13 @@ return redirect('list_bans', list_id) else: addban_form = ListAddBanForm() + banned_addresses = paginate( + list(ban_list), request.GET.get('page'), request.GET.get('count')) return render(request, 'postorius/lists/bans.html', - {'list': m_list, 'addban_form': addban_form}) + {'list': m_list, + 'addban_form': addban_form, + 'banned_addresses': banned_addresses, + }) @login_required