From 4c09477aa26ee94b25d97b625fe6d026661af712 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 2 Apr 2022 09:16:07 -0700 Subject: [PATCH] Improves instance list admin view (#2068) * Removes irrelevent initial federated server data * Adds secondary search order to instance list * Show last updated date * Adds filters to federated server view * Updates unit tests --- bookwyrm/management/commands/initdb.py | 13 ----------- .../settings/federation/instance_filters.html | 7 ++++++ .../settings/federation/instance_list.html | 12 +++++++--- .../settings/federation/software_filter.html | 19 ++++++++++++++++ bookwyrm/tests/management/test_initdb.py | 2 -- bookwyrm/views/admin/federation.py | 22 ++++++++++++++----- 6 files changed, 52 insertions(+), 23 deletions(-) create mode 100644 bookwyrm/templates/settings/federation/instance_filters.html create mode 100644 bookwyrm/templates/settings/federation/software_filter.html diff --git a/bookwyrm/management/commands/initdb.py b/bookwyrm/management/commands/initdb.py index 4e23a5306..160502ca0 100644 --- a/bookwyrm/management/commands/initdb.py +++ b/bookwyrm/management/commands/initdb.py @@ -105,16 +105,6 @@ def init_connectors(): ) -def init_federated_servers(): - """big no to nazis""" - built_in_blocks = ["gab.ai", "gab.com"] - for server in built_in_blocks: - models.FederatedServer.objects.create( - server_name=server, - status="blocked", - ) - - def init_settings(): """info about the instance""" models.SiteSettings.objects.create( @@ -163,7 +153,6 @@ class Command(BaseCommand): "group", "permission", "connector", - "federatedserver", "settings", "linkdomain", ] @@ -176,8 +165,6 @@ class Command(BaseCommand): init_permissions() if not limit or limit == "connector": init_connectors() - if not limit or limit == "federatedserver": - init_federated_servers() if not limit or limit == "settings": init_settings() if not limit or limit == "linkdomain": diff --git a/bookwyrm/templates/settings/federation/instance_filters.html b/bookwyrm/templates/settings/federation/instance_filters.html new file mode 100644 index 000000000..46ae0c1cf --- /dev/null +++ b/bookwyrm/templates/settings/federation/instance_filters.html @@ -0,0 +1,7 @@ +{% extends 'snippets/filters_panel/filters_panel.html' %} + +{% block filter_fields %} +{% include 'settings/federation/software_filter.html' %} + +{% endblock %} + diff --git a/bookwyrm/templates/settings/federation/instance_list.html b/bookwyrm/templates/settings/federation/instance_list.html index 89c50e5e6..65115fab3 100644 --- a/bookwyrm/templates/settings/federation/instance_list.html +++ b/bookwyrm/templates/settings/federation/instance_list.html @@ -12,6 +12,9 @@ {% endblock %} {% block panel %} + +{% include 'settings/federation/instance_filters.html' %} +