mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
homepage_actions() plugin hook, closes #2298
This commit is contained in:
parent
7b32d5f7d8
commit
daf5ca02ca
8 changed files with 118 additions and 2 deletions
|
|
@ -425,6 +425,18 @@ def database_actions(datasette, database, actor, request):
|
|||
]
|
||||
|
||||
|
||||
@hookimpl
|
||||
def homepage_actions(datasette, actor, request):
|
||||
if actor:
|
||||
label = f"Custom homepage for: {actor['id']}"
|
||||
return [
|
||||
{
|
||||
"href": datasette.urls.path("/-/custom-homepage"),
|
||||
"label": label,
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@hookimpl
|
||||
def skip_csrf(scope):
|
||||
return scope["path"] == "/skip-csrf"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue