Commit 4b26d356 by Szeberényi Imre

Merge branch '6-users-list' into 'master'

delete table_pagination=False from view UserList

Closes #6

See merge request !5
parents 18022e0d 6ac4f944
...@@ -172,6 +172,7 @@ class UserListTable(Table): ...@@ -172,6 +172,7 @@ class UserListTable(Table):
is_active = BooleanColumn() is_active = BooleanColumn()
class Meta: class Meta:
per_page = 20
model = User model = User
template = "django_tables2/with_pagination.html" template = "django_tables2/with_pagination.html"
attrs = {'class': ('table table-bordered table-striped table-hover')} attrs = {'class': ('table table-bordered table-striped table-hover')}
......
...@@ -43,7 +43,7 @@ from simplesshkey.models import UserKey ...@@ -43,7 +43,7 @@ from simplesshkey.models import UserKey
from braces.views import LoginRequiredMixin, PermissionRequiredMixin from braces.views import LoginRequiredMixin, PermissionRequiredMixin
from django_tables2 import SingleTableView from django_tables2 import SingleTableView, LazyPaginator
from vm.models import Instance, InstanceTemplate from vm.models import Instance, InstanceTemplate
...@@ -537,12 +537,12 @@ class ConnectCommandCreate(LoginRequiredMixin, SuccessMessageMixin, ...@@ -537,12 +537,12 @@ class ConnectCommandCreate(LoginRequiredMixin, SuccessMessageMixin,
return kwargs return kwargs
class UserList(LoginRequiredMixin, PermissionRequiredMixin, SingleTableView): class UserList(LoginRequiredMixin, PermissionRequiredMixin,
SingleTableView):
template_name = "dashboard/user-list.html" template_name = "dashboard/user-list.html"
permission_required = "auth.change_user" permission_required = "auth.change_user"
model = User model = User
table_class = UserListTable table_class = UserListTable
table_pagination = True
def get_context_data(self, *args, **kwargs): def get_context_data(self, *args, **kwargs):
context = super(UserList, self).get_context_data(*args, **kwargs) context = super(UserList, self).get_context_data(*args, **kwargs)
...@@ -552,7 +552,6 @@ class UserList(LoginRequiredMixin, PermissionRequiredMixin, SingleTableView): ...@@ -552,7 +552,6 @@ class UserList(LoginRequiredMixin, PermissionRequiredMixin, SingleTableView):
def get(self, *args, **kwargs): def get(self, *args, **kwargs):
self.search_form = UserListSearchForm(self.request.GET) self.search_form = UserListSearchForm(self.request.GET)
self.search_form.full_clean() self.search_form.full_clean()
if self.request.is_ajax(): if self.request.is_ajax():
users = [ users = [
{'url': reverse("dashboard.views.profile", args=[i.username]), {'url': reverse("dashboard.views.profile", args=[i.username]),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment