Navigation menu plus menu_links() hook

Closes #1064, refs #690.
This commit is contained in:
Simon Willison 2020-10-29 20:45:15 -07:00 committed by GitHub
commit 18a64fbb29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 193 additions and 13 deletions

View file

@ -290,3 +290,9 @@ def forbidden(datasette, request, message):
datasette._last_forbidden_message = message
if request.path == "/data2":
return Response.redirect("/login?message=" + message)
@hookimpl
def menu_links(datasette, actor):
if actor:
return [{"href": datasette.urls.instance(), "label": "Hello"}]