diff --git a/bookwyrm/templates/settings/admin_layout.html b/bookwyrm/templates/settings/admin_layout.html index f66da658..59cfd1d4 100644 --- a/bookwyrm/templates/settings/admin_layout.html +++ b/bookwyrm/templates/settings/admin_layout.html @@ -14,6 +14,10 @@ {% url 'settings-invites' as url %} Invites +
Server name | +Software | +Status | +
---|---|---|
{{ server.server_name }} | +{{ server.application_type }} ({{ server.application_version }}) | +{{ server.status }} | +
[A-Za-z0-9]+)/?$', views.Invite.as_view()),
diff --git a/bookwyrm/views/__init__.py b/bookwyrm/views/__init__.py
index 62c4110f..0b93f164 100644
--- a/bookwyrm/views/__init__.py
+++ b/bookwyrm/views/__init__.py
@@ -5,6 +5,7 @@ from .block import Block, unblock
from .books import Book, EditBook, Editions
from .books import upload_cover, add_description, switch_edition, resolve_book
from .error import not_found_page, server_error_page
+from .federation import Federation
from .feed import DirectMessage, Feed, Replies, Status
from .follow import follow, unfollow
from .follow import accept_follow_request, delete_follow_request, handle_accept
diff --git a/bookwyrm/views/federation.py b/bookwyrm/views/federation.py
new file mode 100644
index 00000000..0bd14dab
--- /dev/null
+++ b/bookwyrm/views/federation.py
@@ -0,0 +1,24 @@
+''' manage federated servers '''
+from django.contrib.auth.decorators import login_required, permission_required
+from django.template.response import TemplateResponse
+from django.utils.decorators import method_decorator
+from django.views import View
+
+from bookwyrm import models
+
+
+# pylint: disable= no-self-use
+@method_decorator(login_required, name='dispatch')
+@method_decorator(
+ permission_required('bookwyrm.control_federation', raise_exception=True),
+ name='dispatch')
+class Federation(View):
+ ''' what servers do we federate with '''
+ def get(self, request):
+ ''' edit form '''
+ servers = models.FederatedServer.objects.all()
+ data = {
+ 'title': 'Federated Servers',
+ 'servers': servers
+ }
+ return TemplateResponse(request, 'settings/federation.html', data)