From 8220547ecd85d6bfc5d6b2576a75f285963128cd Mon Sep 17 00:00:00 2001 From: JianweiGao Date: Mon, 1 Oct 2018 16:23:22 +0800 Subject: [PATCH] Added pagination for the users list page No longer load all users with "/users/all" to filter usernames and email Load the all entitlements with the "/entitlements" api instead of traversing all the users Set default value for the call limits inputs --- apimanager/consumers/forms.py | 5 ++ .../users/includes/filter_pagination.html | 11 +++++ apimanager/users/templates/users/index.html | 9 ++++ apimanager/users/views.py | 46 +++++++++++++------ requirements.txt | 3 +- 5 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 apimanager/users/templates/users/includes/filter_pagination.html diff --git a/apimanager/consumers/forms.py b/apimanager/consumers/forms.py index 5d8e892..79f673b 100644 --- a/apimanager/consumers/forms.py +++ b/apimanager/consumers/forms.py @@ -19,6 +19,7 @@ class ApiConsumersForm(forms.Form): 'class': 'form-control', } ), + initial=-1, required=False, ) @@ -29,6 +30,7 @@ class ApiConsumersForm(forms.Form): 'class': 'form-control', } ), + initial=-1, required=False, ) per_day_call_limit = forms.IntegerField( @@ -38,6 +40,7 @@ class ApiConsumersForm(forms.Form): 'class': 'form-control', } ), + initial=-1, required=False, ) per_week_call_limit = forms.IntegerField( @@ -47,6 +50,7 @@ class ApiConsumersForm(forms.Form): 'class': 'form-control', } ), + initial=-1, required=False, ) @@ -57,5 +61,6 @@ class ApiConsumersForm(forms.Form): 'class': 'form-control', } ), + initial=-1, required=False, ) diff --git a/apimanager/users/templates/users/includes/filter_pagination.html b/apimanager/users/templates/users/includes/filter_pagination.html new file mode 100644 index 0000000..340a898 --- /dev/null +++ b/apimanager/users/templates/users/includes/filter_pagination.html @@ -0,0 +1,11 @@ +
+
+ + +
+
+ + +
+ +
\ No newline at end of file diff --git a/apimanager/users/templates/users/index.html b/apimanager/users/templates/users/index.html index e45476f..b7b1d92 100644 --- a/apimanager/users/templates/users/index.html +++ b/apimanager/users/templates/users/index.html @@ -28,6 +28,15 @@ + +
+
+ +

Pagination

+ {% include "users/includes/filter_pagination.html" %} +
+
+

Statistics