From 2a27325dfdded9e11fc3a91d592fabde6626ae6c Mon Sep 17 00:00:00 2001 From: "Langhammer, Jens" Date: Mon, 14 Oct 2019 13:15:42 +0200 Subject: [PATCH] admin(major): add pagination to all listviews --- .../admin/templates/administration/application/list.html | 1 + passbook/admin/templates/administration/factor/list.html | 1 + passbook/admin/templates/administration/group/list.html | 1 + .../admin/templates/administration/invitation/list.html | 1 + passbook/admin/templates/administration/policy/list.html | 1 + .../templates/administration/property_mapping/list.html | 1 + .../admin/templates/administration/provider/list.html | 1 + passbook/admin/templates/administration/source/list.html | 1 + passbook/admin/templates/administration/user/list.html | 1 + passbook/admin/views/applications.py | 1 + passbook/admin/views/factors.py | 1 + passbook/admin/views/groups.py | 1 + passbook/admin/views/invitations.py | 2 ++ passbook/admin/views/policy.py | 2 ++ passbook/admin/views/property_mapping.py | 1 + passbook/admin/views/providers.py | 1 + passbook/admin/views/sources.py | 2 ++ passbook/admin/views/users.py | 2 ++ passbook/sources/ldap/models.py | 8 -------- 19 files changed, 22 insertions(+), 8 deletions(-) diff --git a/passbook/admin/templates/administration/application/list.html b/passbook/admin/templates/administration/application/list.html index 711f19443..40ebd9769 100644 --- a/passbook/admin/templates/administration/application/list.html +++ b/passbook/admin/templates/administration/application/list.html @@ -41,5 +41,6 @@ {% endfor %} + {% include 'partials/pagination.html' %} {% endblock %} diff --git a/passbook/admin/templates/administration/factor/list.html b/passbook/admin/templates/administration/factor/list.html index 31a0721bd..731476af7 100644 --- a/passbook/admin/templates/administration/factor/list.html +++ b/passbook/admin/templates/administration/factor/list.html @@ -58,5 +58,6 @@ {% endfor %} + {% include 'partials/pagination.html' %} {% endblock %} diff --git a/passbook/admin/templates/administration/group/list.html b/passbook/admin/templates/administration/group/list.html index 4a87521b0..95ddcefbf 100644 --- a/passbook/admin/templates/administration/group/list.html +++ b/passbook/admin/templates/administration/group/list.html @@ -41,5 +41,6 @@ {% endfor %} + {% include 'partials/pagination.html' %} {% endblock %} diff --git a/passbook/admin/templates/administration/invitation/list.html b/passbook/admin/templates/administration/invitation/list.html index 253c5d8fe..299374c1b 100644 --- a/passbook/admin/templates/administration/invitation/list.html +++ b/passbook/admin/templates/administration/invitation/list.html @@ -39,5 +39,6 @@ {% endfor %} + {% include 'partials/pagination.html' %} {% endblock %} diff --git a/passbook/admin/templates/administration/policy/list.html b/passbook/admin/templates/administration/policy/list.html index 7ed1e102d..f632e940e 100644 --- a/passbook/admin/templates/administration/policy/list.html +++ b/passbook/admin/templates/administration/policy/list.html @@ -58,5 +58,6 @@ {% endfor %} + {% include 'partials/pagination.html' %} {% endblock %} diff --git a/passbook/admin/templates/administration/property_mapping/list.html b/passbook/admin/templates/administration/property_mapping/list.html index 9076adab7..83bf8a255 100644 --- a/passbook/admin/templates/administration/property_mapping/list.html +++ b/passbook/admin/templates/administration/property_mapping/list.html @@ -48,5 +48,6 @@ {% endfor %} + {% include 'partials/pagination.html' %} {% endblock %} diff --git a/passbook/admin/templates/administration/provider/list.html b/passbook/admin/templates/administration/provider/list.html index ace453870..189b2da4f 100644 --- a/passbook/admin/templates/administration/provider/list.html +++ b/passbook/admin/templates/administration/provider/list.html @@ -66,5 +66,6 @@ {% endfor %} + {% include 'partials/pagination.html' %} {% endblock %} diff --git a/passbook/admin/templates/administration/source/list.html b/passbook/admin/templates/administration/source/list.html index 0dcd5c2da..b2de358b2 100644 --- a/passbook/admin/templates/administration/source/list.html +++ b/passbook/admin/templates/administration/source/list.html @@ -52,5 +52,6 @@ {% endfor %} + {% include 'partials/pagination.html' %} {% endblock %} diff --git a/passbook/admin/templates/administration/user/list.html b/passbook/admin/templates/administration/user/list.html index 9a154f0f4..766c59ef0 100644 --- a/passbook/admin/templates/administration/user/list.html +++ b/passbook/admin/templates/administration/user/list.html @@ -42,5 +42,6 @@ {% endfor %} + {% include 'partials/pagination.html' %} {% endblock %} diff --git a/passbook/admin/views/applications.py b/passbook/admin/views/applications.py index 8e5f58b6d..be9399c97 100644 --- a/passbook/admin/views/applications.py +++ b/passbook/admin/views/applications.py @@ -15,6 +15,7 @@ class ApplicationListView(AdminRequiredMixin, ListView): model = Application ordering = 'name' + paginate_by = 40 template_name = 'administration/application/list.html' def get_queryset(self): diff --git a/passbook/admin/views/factors.py b/passbook/admin/views/factors.py index dd5a689cd..a19af3b5f 100644 --- a/passbook/admin/views/factors.py +++ b/passbook/admin/views/factors.py @@ -22,6 +22,7 @@ class FactorListView(AdminRequiredMixin, ListView): model = Factor template_name = 'administration/factor/list.html' ordering = 'order' + paginate_by = 40 def get_context_data(self, **kwargs): kwargs['types'] = { diff --git a/passbook/admin/views/groups.py b/passbook/admin/views/groups.py index 1e120669d..537642e07 100644 --- a/passbook/admin/views/groups.py +++ b/passbook/admin/views/groups.py @@ -15,6 +15,7 @@ class GroupListView(AdminRequiredMixin, ListView): model = Group ordering = 'name' + paginate_by = 40 template_name = 'administration/group/list.html' diff --git a/passbook/admin/views/invitations.py b/passbook/admin/views/invitations.py index a203e05cf..fc9f20885 100644 --- a/passbook/admin/views/invitations.py +++ b/passbook/admin/views/invitations.py @@ -16,6 +16,8 @@ class InvitationListView(AdminRequiredMixin, ListView): """Show list of all invitations""" model = Invitation + ordering = 'expires' + paginate_by = 40 template_name = 'administration/invitation/list.html' diff --git a/passbook/admin/views/policy.py b/passbook/admin/views/policy.py index 541d70e09..da5f03460 100644 --- a/passbook/admin/views/policy.py +++ b/passbook/admin/views/policy.py @@ -19,6 +19,8 @@ class PolicyListView(AdminRequiredMixin, ListView): """Show list of all policies""" model = Policy + ordering = 'name' + paginate_by = 40 template_name = 'administration/policy/list.html' def get_context_data(self, **kwargs): diff --git a/passbook/admin/views/property_mapping.py b/passbook/admin/views/property_mapping.py index c4cf7fad3..7d69fe646 100644 --- a/passbook/admin/views/property_mapping.py +++ b/passbook/admin/views/property_mapping.py @@ -23,6 +23,7 @@ class PropertyMappingListView(AdminRequiredMixin, ListView): model = PropertyMapping template_name = 'administration/property_mapping/list.html' ordering = 'name' + paginate_by = 40 def get_context_data(self, **kwargs): kwargs['types'] = { diff --git a/passbook/admin/views/providers.py b/passbook/admin/views/providers.py index 77e9f5a81..b615e87e0 100644 --- a/passbook/admin/views/providers.py +++ b/passbook/admin/views/providers.py @@ -15,6 +15,7 @@ class ProviderListView(AdminRequiredMixin, ListView): """Show list of all providers""" model = Provider + paginate_by = 40 template_name = 'administration/provider/list.html' def get_context_data(self, **kwargs): diff --git a/passbook/admin/views/sources.py b/passbook/admin/views/sources.py index ea74e1d78..58a94d3d6 100644 --- a/passbook/admin/views/sources.py +++ b/passbook/admin/views/sources.py @@ -20,6 +20,8 @@ class SourceListView(AdminRequiredMixin, ListView): """Show list of all sources""" model = Source + ordering = 'name' + paginate_by = 40 template_name = 'administration/source/list.html' def get_context_data(self, **kwargs): diff --git a/passbook/admin/views/users.py b/passbook/admin/views/users.py index 0185d046e..b9b6f15a6 100644 --- a/passbook/admin/views/users.py +++ b/passbook/admin/views/users.py @@ -16,6 +16,8 @@ class UserListView(AdminRequiredMixin, ListView): """Show list of all users""" model = User + ordering = 'username' + paginate_by = 40 template_name = 'administration/user/list.html' diff --git a/passbook/sources/ldap/models.py b/passbook/sources/ldap/models.py index 58b5fd0e4..88acc16d3 100644 --- a/passbook/sources/ldap/models.py +++ b/passbook/sources/ldap/models.py @@ -32,16 +32,8 @@ class LDAPSource(Source): sync_parent_group = models.ForeignKey(Group, blank=True, null=True, default=None, on_delete=models.SET_DEFAULT) - # This field is written to by the sync_* tasks - # displayed by additional_info - status = models.TextField(default="") - form = 'passbook.sources.ldap.forms.LDAPSourceForm' - @property - def additional_info(self): - return self.status - class Meta: verbose_name = _('LDAP Source')