From 8dc0e1877b385dd1b0a8376f6e827bf4c58509e1 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Thu, 14 Jul 2022 20:05:36 +0200 Subject: [PATCH] Tweak/improve admin --- app/admin.py | 4 ++-- app/templates/admin_inbox.html | 6 ++++++ app/templates/layout.html | 2 +- docs/user_guide.md | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/admin.py b/app/admin.py index 44f35b6..f939f5e 100644 --- a/app/admin.py +++ b/app/admin.py @@ -700,13 +700,13 @@ async def login( async def login_validation( request: Request, password: str = Form(), - redirect: str = Form(), + redirect: str | None = Form(None), csrf_check: None = Depends(verify_csrf_token), ) -> RedirectResponse: if not verify_password(password): raise HTTPException(status_code=401) - resp = RedirectResponse(redirect or "/admin/inbox", status_code=302) + resp = RedirectResponse(redirect or "/admin/stream", status_code=302) resp.set_cookie("session", session_serializer.dumps({"is_logged_in": True})) # type: ignore # noqa: E501 return resp diff --git a/app/templates/admin_inbox.html b/app/templates/admin_inbox.html index 721d103..3e0f513 100644 --- a/app/templates/admin_inbox.html +++ b/app/templates/admin_inbox.html @@ -14,6 +14,12 @@ {% endmacro %} +{% if not inbox %} +
+

Nothing to see yet, start following people in the lookup section.

+
+{% endif %} + {% for inbox_object in inbox %} {% if inbox_object.ap_type == "Announce" %} {{ actor_action(inbox_object, "shared") }} diff --git a/app/templates/layout.html b/app/templates/layout.html index ec92d46..c2b01bd 100644 --- a/app/templates/layout.html +++ b/app/templates/layout.html @@ -45,7 +45,7 @@ diff --git a/docs/user_guide.md b/docs/user_guide.md index 0814d9b..845a2ae 100644 --- a/docs/user_guide.md +++ b/docs/user_guide.md @@ -45,7 +45,8 @@ And only the last 20 interactions (likes/shares/webmentions) will be displayed, ## Admin section -You can login to the admin section by visiting `https://yourdomain.tld/admin` and use the password set during the initial configuration. +You can login to the admin section by clicking on the `Admin` link in the footer or by visiting `https://yourdomain.tld/admin`. +The password is the one set during the initial configuration. ### Lookup