Federated and blocked tabs

This commit is contained in:
Mouse Reeve 2021-09-11 14:41:52 -07:00
parent 6f531beb1c
commit 0f3e71978e
3 changed files with 16 additions and 3 deletions

View file

@ -12,6 +12,19 @@
{% endblock %}
{% block panel %}
<div class="tabs">
<ul>
{% url 'settings-federation' status='federated' as url %}
<li {% if request.path in url %}class="is-active" aria-current="page"{% endif %}>
<a href="{{ url }}">{% trans "Federated" %}</a>
</li>
{% url 'settings-federation' status='blocked' as url %}
<li {% if url in request.path %}class="is-active" aria-current="page"{% endif %}>
<a href="{{ url }}">{% trans "Blocked" %}</a>
</li>
</ul>
</div>
<table class="table is-striped">
<tr>
{% url 'settings-federation' as url %}

View file

@ -98,7 +98,7 @@ urlpatterns = [
name="settings-user",
),
re_path(
r"^settings/federation/?$",
r"^settings/federation/(?P<status>(federated|blocked))?/?$",
views.Federation.as_view(),
name="settings-federation",
),

View file

@ -22,9 +22,9 @@ from bookwyrm.settings import PAGE_LENGTH
class Federation(View):
"""what servers do we federate with"""
def get(self, request):
def get(self, request, status="federated"):
"""list of servers"""
servers = models.FederatedServer.objects
servers = models.FederatedServer.objects.filter(status=status)
sort = request.GET.get("sort")
sort_fields = ["created_date", "application_type", "server_name"]