Refine publisher dashboard layout
This commit is contained in:
parent
2147d9c999
commit
813f19f355
8 changed files with 350 additions and 53 deletions
|
|
@ -1,10 +1,10 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Awaitable, Callable
|
||||
from typing import Any
|
||||
from typing import Any, cast
|
||||
|
||||
from datastar_py.quart import DatastarResponse
|
||||
from quart import Quart, Response
|
||||
from quart import Quart, Response, redirect
|
||||
|
||||
from repub.web.app import _page_patch_response, _shim_page_response, render_dashboard
|
||||
|
||||
|
|
@ -12,6 +12,11 @@ RouteGuard = Callable[[Callable[..., Awaitable[Any]]], Callable[..., Awaitable[A
|
|||
|
||||
|
||||
def register_dashboard_routes(app: Quart, *, admin_required: RouteGuard) -> None:
|
||||
@app.get("/admin/")
|
||||
@admin_required
|
||||
async def admin_dashboard_trailing_slash() -> Response:
|
||||
return cast(Response, redirect("/admin"))
|
||||
|
||||
@app.get("/admin")
|
||||
@admin_required
|
||||
async def admin_dashboard_home() -> Response:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue