From a68196d9bbd5cfa2d68142afd4f320633890f1e9 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 6 Sep 2021 08:54:57 -0700 Subject: [PATCH 1/2] Improves user admin filter behavior --- bookwyrm/templates/user_admin/user_admin_filters.html | 2 +- bookwyrm/views/user_admin.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bookwyrm/templates/user_admin/user_admin_filters.html b/bookwyrm/templates/user_admin/user_admin_filters.html index 5283b4e9c..c9c7a93fc 100644 --- a/bookwyrm/templates/user_admin/user_admin_filters.html +++ b/bookwyrm/templates/user_admin/user_admin_filters.html @@ -1,7 +1,7 @@ {% extends 'snippets/filters_panel/filters_panel.html' %} {% block filter_fields %} -{% include 'user_admin/server_filter.html' %} {% include 'user_admin/username_filter.html' %} {% include 'directory/community_filter.html' %} +{% include 'user_admin/server_filter.html' %} {% endblock %} diff --git a/bookwyrm/views/user_admin.py b/bookwyrm/views/user_admin.py index 3a9ea3392..ac5357a28 100644 --- a/bookwyrm/views/user_admin.py +++ b/bookwyrm/views/user_admin.py @@ -31,8 +31,8 @@ class UserAdminList(View): if username: filters["username__icontains"] = username scope = request.GET.get("scope") - if scope: - filters["local"] = scope == "local" + if scope and scope == "local": + filters["local"] = True users = models.User.objects.filter(**filters) From 2886c15e1d70d1ee8acbd3e0cd9825f7affa7688 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 6 Sep 2021 09:35:25 -0700 Subject: [PATCH 2/2] Adds more info to user admin page --- bookwyrm/templates/user_admin/user.html | 12 +-- bookwyrm/templates/user_admin/user_info.html | 93 +++++++++++++++++++- 2 files changed, 99 insertions(+), 6 deletions(-) diff --git a/bookwyrm/templates/user_admin/user.html b/bookwyrm/templates/user_admin/user.html index c79c6971f..5c118175b 100644 --- a/bookwyrm/templates/user_admin/user.html +++ b/bookwyrm/templates/user_admin/user.html @@ -2,13 +2,15 @@ {% load i18n %} {% block title %}{{ user.username }}{% endblock %} -{% block header %}{{ user.username }}{% endblock %} +{% block header %} +{{ user.username }} +

+ {% trans "Back to users" %} +

+ +{% endblock %} {% block panel %} - - {% include 'user_admin/user_info.html' with user=user %} {% include 'user_admin/user_moderation_actions.html' with user=user %} diff --git a/bookwyrm/templates/user_admin/user_info.html b/bookwyrm/templates/user_admin/user_info.html index 579b3af7e..69a84a664 100644 --- a/bookwyrm/templates/user_admin/user_info.html +++ b/bookwyrm/templates/user_admin/user_info.html @@ -1,8 +1,10 @@ {% load i18n %} {% load markdown %} +{% load humanize %} +
-

{% trans "User details" %}

+

{% trans "Profile" %}

{% include 'user/user_preview.html' with user=user %} {% if user.summary %} @@ -14,6 +16,95 @@

{% trans "View user profile" %}

+
+

{% trans "Status" %}

+
+ {% if user.is_active %} +

+ {% trans "Active" %} +

+ {% else %} +

+ {% trans "Inactive" %} + {% if user.deactivation_reason %} + ({{ user.deactivation_reason }}) + {% endif %} +

+ {% endif %} +

+ {% if user.local %} + {% trans "Local" %} + {% else %} + {% trans "Remote" %} + {% endif %} +

+
+
+
+ +
+
+

{% trans "User details" %}

+
+
+ {% if user.local %} +
+
{% trans "Email:" %}
+
{{ user.email }}
+
+ {% endif %} + + {% with report_count=user.report_set.count %} +
+
{% trans "Reports:" %}
+
+ {{ report_count|intcomma }} + {% if report_count > 0 %} + + {% trans "(View reports)" %} + + {% endif %} +
+
+ {% endwith %} + +
+
{% trans "Blocked by count:" %}
+
{{ user.blocked_by.count }}
+
+ +
+
{% trans "Last active date:" %}
+
{{ user.last_active_date }}
+
+ +
+
{% trans "Manually approved followers:" %}
+
{{ user.manually_approves_followers }}
+
+ +
+
{% trans "Discoverable:" %}
+
{{ user.discoverable }}
+
+ + {% if not user.is_active %} +
+
{% trans "Deactivation reason:" %}
+
{{ user.deactivation_reason }}
+
+ {% endif %} + + {% if not user.is_active and user.deactivation_reason == "pending" %} +
+
{% trans "Confirmation code:" %}
+
{{ user.confirmation_code }}
+
+ {% endif %} +
+
+
+ {% if not user.local %} {% with server=user.federated_server %}