admin(major): add pagination to all listviews

This commit is contained in:
Langhammer, Jens 2019-10-14 13:15:42 +02:00
parent a6dee2e8ed
commit 2a27325dfd
19 changed files with 22 additions and 8 deletions

View File

@ -41,5 +41,6 @@
{% endfor %}
</tbody>
</table>
{% include 'partials/pagination.html' %}
</div>
{% endblock %}

View File

@ -58,5 +58,6 @@
{% endfor %}
</tbody>
</table>
{% include 'partials/pagination.html' %}
</div>
{% endblock %}

View File

@ -41,5 +41,6 @@
{% endfor %}
</tbody>
</table>
{% include 'partials/pagination.html' %}
</div>
{% endblock %}

View File

@ -39,5 +39,6 @@
{% endfor %}
</tbody>
</table>
{% include 'partials/pagination.html' %}
</div>
{% endblock %}

View File

@ -58,5 +58,6 @@
{% endfor %}
</tbody>
</table>
{% include 'partials/pagination.html' %}
</div>
{% endblock %}

View File

@ -48,5 +48,6 @@
{% endfor %}
</tbody>
</table>
{% include 'partials/pagination.html' %}
</div>
{% endblock %}

View File

@ -66,5 +66,6 @@
{% endfor %}
</tbody>
</table>
{% include 'partials/pagination.html' %}
</div>
{% endblock %}

View File

@ -52,5 +52,6 @@
{% endfor %}
</tbody>
</table>
{% include 'partials/pagination.html' %}
</div>
{% endblock %}

View File

@ -42,5 +42,6 @@
{% endfor %}
</tbody>
</table>
{% include 'partials/pagination.html' %}
</div>
{% endblock %}

View File

@ -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):

View File

@ -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'] = {

View File

@ -15,6 +15,7 @@ class GroupListView(AdminRequiredMixin, ListView):
model = Group
ordering = 'name'
paginate_by = 40
template_name = 'administration/group/list.html'

View File

@ -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'

View File

@ -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):

View File

@ -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'] = {

View File

@ -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):

View File

@ -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):

View File

@ -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'

View File

@ -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')