diff --git a/src/postorius/templates/postorius/lists/members.html b/src/postorius/templates/postorius/lists/members.html
index 5dff07d..c7cf293 100644
--- a/src/postorius/templates/postorius/lists/members.html
+++ b/src/postorius/templates/postorius/lists/members.html
@@ -78,7 +78,7 @@
{% trans 'CSV Export' %}
- {% for member in list.member_page %}
+ {% for member in members %}
{{ member.email }}
@@ -91,22 +91,6 @@
-
+ {% include 'postorius/_pagination.html' with page=members %}
{% endblock main %}
diff --git a/src/postorius/urls.py b/src/postorius/urls.py
index b604584..ed5b82b 100644
--- a/src/postorius/urls.py
+++ b/src/postorius/urls.py
@@ -27,9 +27,6 @@
per_list_urlpatterns = patterns('postorius.views',
- url(r'^members/(?P\d+)/$',
- ListMembersView.as_view(
- ), name='list_members_paged'),
url(r'^csv_view/$',
'csv_view', name='csv_view'),
url(r'^members/$',
diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py
index a580d25..b94d4e6 100644
--- a/src/postorius/views/list.py
+++ b/src/postorius/views/list.py
@@ -49,17 +49,10 @@
"""Display all members of a given list.
"""
- def _get_list(self, list_id, page):
- m_list = super(ListMembersView, self)._get_list(list_id, page)
- m_list.member_page = m_list.get_member_page(25, page)
- m_list.member_page_nr = page
- m_list.member_page_previous_nr = page - 1
- m_list.member_page_next_nr = page + 1
- m_list.member_page_show_next = len(m_list.member_page) >= 25
- return m_list
-
@method_decorator(list_owner_required)
- def post(self, request, list_id, page=1):
+ def post(self, request, list_id):
+ # FIXME: form usage is wrong here, they should be instantiated only
+ # once or the form errors will be erased.
if 'owner_email' in request.POST:
owner_form = NewOwnerForm(request.POST)
if owner_form.is_valid():
@@ -84,20 +77,30 @@
messages.error(request, _(e.msg))
owner_form = NewOwnerForm()
moderator_form = NewModeratorForm()
+ members = utils.paginate(
+ request, self.mailing_list.get_member_page, 25,
+ paginator_class=utils.MailmanPaginator)
return render_to_response('postorius/lists/members.html',
{'list': self.mailing_list,
'owner_form': owner_form,
- 'moderator_form': moderator_form},
+ 'moderator_form': moderator_form,
+ 'members': members,
+ },
context_instance=RequestContext(request))
@method_decorator(list_owner_required)
def get(self, request, list_id, page=1):
owner_form = NewOwnerForm()
moderator_form = NewModeratorForm()
+ members = utils.paginate(
+ request, self.mailing_list.get_member_page, 25,
+ paginator_class=utils.MailmanPaginator)
return render_to_response('postorius/lists/members.html',
{'list': self.mailing_list,
'owner_form': owner_form,
- 'moderator_form': moderator_form},
+ 'moderator_form': moderator_form,
+ 'members': members,
+ },
context_instance=RequestContext(request))