Skip to content
Snippets Groups Projects
Commit fc5c965c authored by sandeepsajan0's avatar sandeepsajan0 Committed by Fredrik Jonsson
Browse files

User count show total number of users not only the no of users on page

parent e1a62c0d
No related branches found
No related tags found
No related merge requests found
......@@ -104,12 +104,14 @@ def index(request):
else:
ordering = 'name'
user_count = users.count()
paginator = Paginator(users, per_page=20)
users = paginator.get_page(request.GET.get('p'))
if request.headers.get('x-requested-with') == 'XMLHttpRequest':
return render(request, "wagtailusers/users/results.html", {
'users': users,
'user_count': user_count,
'is_searching': is_searching,
'query_string': q,
'filters': filters,
......@@ -121,6 +123,7 @@ def index(request):
return render(request, "wagtailusers/users/index.html", {
'search_form': form,
'users': users,
'user_count': user_count,
'is_searching': is_searching,
'ordering': ordering,
'query_string': q,
......
......@@ -3,10 +3,10 @@
<div class="users-list__results">
{% if users %}
<h2 role="alert">
{% blocktrans trimmed count counter=users|length %}
There is {{ counter }} user
{% blocktrans trimmed count count=user_count %}
There is {{ user_count }} user
{% plural %}
There are {{ counter }} users
There are {{ user_count }} users
{% endblocktrans %}
</h2>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment