forked from mirrors/bookwyrm
Federated and blocked tabs
This commit is contained in:
parent
6f531beb1c
commit
0f3e71978e
3 changed files with 16 additions and 3 deletions
|
@ -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 %}
|
||||
|
|
|
@ -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",
|
||||
),
|
||||
|
|
|
@ -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"]
|
||||
|
|
Loading…
Reference in a new issue