diff --git a/bookwyrm/templates/settings/users/user_admin.html b/bookwyrm/templates/settings/users/user_admin.html
index 874ce818..e3de7793 100644
--- a/bookwyrm/templates/settings/users/user_admin.html
+++ b/bookwyrm/templates/settings/users/user_admin.html
@@ -1,5 +1,7 @@
{% extends 'settings/layout.html' %}
{% load i18n %}
+{% load utilities %}
+
{% block title %}{% trans "Users" %}{% endblock %}
{% block header %}
@@ -15,46 +17,67 @@
{% include 'settings/users/user_admin_filters.html' %}
-
-
- {% url 'settings-users' as url %}
-
- {% trans "Username" as text %}
- {% include 'snippets/table-sort-header.html' with field="username" sort=sort text=text %}
- |
-
- {% trans "Date Added" as text %}
- {% include 'snippets/table-sort-header.html' with field="created_date" sort=sort text=text %}
- |
-
- {% trans "Last Active" as text %}
- {% include 'snippets/table-sort-header.html' with field="last_active_date" sort=sort text=text %}
- |
-
- {% trans "Status" as text %}
- {% include 'snippets/table-sort-header.html' with field="is_active" sort=sort text=text %}
- |
-
- {% trans "Remote instance" as text %}
- {% include 'snippets/table-sort-header.html' with field="federated_server__server_name" sort=sort text=text %}
- |
-
- {% for user in users %}
-
- {{ user.username }} |
- {{ user.created_date }} |
- {{ user.last_active_date }} |
- {% if user.is_active %}{% trans "Active" %}{% else %}{% trans "Inactive" %}{% endif %} |
-
- {% if user.federated_server %}
- {{ user.federated_server.server_name }}
- {% elif not user.local %}
- {% trans "Not set" %}
+
+
+
+
+
+ {% url 'settings-users' as url %}
+
+ {% trans "Username" as text %}
+ {% include 'snippets/table-sort-header.html' with field="username" sort=sort text=text %}
+ |
+
+ {% trans "Date Added" as text %}
+ {% include 'snippets/table-sort-header.html' with field="created_date" sort=sort text=text %}
+ |
+
+ {% trans "Last Active" as text %}
+ {% include 'snippets/table-sort-header.html' with field="last_active_date" sort=sort text=text %}
+ |
+
+ {% trans "Status" as text %}
+ {% include 'snippets/table-sort-header.html' with field="is_active" sort=sort text=text %}
+ |
+ {% if status != "local" %}
+
+ {% trans "Remote instance" as text %}
+ {% include 'snippets/table-sort-header.html' with field="federated_server__server_name" sort=sort text=text %}
+ |
{% endif %}
-
-
- {% endfor %}
-
+ |
+ {% for user in users %}
+
+ {{ user|username }} |
+ {{ user.created_date }} |
+ {{ user.last_active_date }} |
+ {% if user.is_active %}{% trans "Active" %}{% else %}{% trans "Inactive" %}{% endif %} |
+ {% if status != "local" %}
+
+ {% if user.federated_server %}
+ {{ user.federated_server.server_name }}
+ {% else %}
+ {% trans "Not set" %}
+ {% endif %}
+ |
+ {% endif %}
+
+ {% endfor %}
+
+
{% include 'snippets/pagination.html' with page=users path=request.path %}
{% endblock %}
diff --git a/bookwyrm/urls.py b/bookwyrm/urls.py
index b9c348a4..4d7f503f 100644
--- a/bookwyrm/urls.py
+++ b/bookwyrm/urls.py
@@ -125,6 +125,11 @@ urlpatterns = [
re_path(
r"^settings/users/?$", views.UserAdminList.as_view(), name="settings-users"
),
+ re_path(
+ r"^settings/users/(?P(local|federated))\/?$",
+ views.UserAdminList.as_view(),
+ name="settings-users",
+ ),
re_path(
r"^settings/users/(?P\d+)/?$",
views.UserAdmin.as_view(),
diff --git a/bookwyrm/views/admin/user_admin.py b/bookwyrm/views/admin/user_admin.py
index aa847959..df716d2c 100644
--- a/bookwyrm/views/admin/user_admin.py
+++ b/bookwyrm/views/admin/user_admin.py
@@ -19,7 +19,7 @@ from bookwyrm.settings import PAGE_LENGTH
class UserAdminList(View):
"""admin view of users on this server"""
- def get(self, request):
+ def get(self, request, status="local"):
"""list of users"""
filters = {}
server = request.GET.get("server")
@@ -37,6 +37,8 @@ class UserAdminList(View):
if email:
filters["email__endswith"] = email
+ filters["local"] = status == "local"
+
users = models.User.objects.filter(**filters)
sort = request.GET.get("sort", "-created_date")
@@ -56,6 +58,7 @@ class UserAdminList(View):
"users": paginated.get_page(request.GET.get("page")),
"sort": sort,
"server": server,
+ "status": status,
}
return TemplateResponse(request, "settings/users/user_admin.html", data)