views_api.py exposes the booking flow over HTTP — availability check, guest booking request (check-then-hold with canonical amount_sat), room publish, blocks. REST and Nostr are two doors into the same crud flow; FX + invoice creation marked TODO. views.py serves the operator page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VUQCfdqiLSsFS2jcGnaFD
22 lines
829 B
Python
22 lines
829 B
Python
"""Frontend routes — serves the operator admin page. SKETCH: single index
|
|
template; the guest-facing booking UI is expected to live in the webapp
|
|
(standalone app pattern), talking to this extension over Nostr/REST."""
|
|
|
|
from fastapi import APIRouter, Depends, Request
|
|
from fastapi.responses import HTMLResponse
|
|
from lnbits.core.models import User
|
|
from lnbits.decorators import check_user_exists
|
|
from lnbits.helpers import template_renderer
|
|
|
|
chatelet_generic_router = APIRouter()
|
|
|
|
|
|
def chatelet_renderer():
|
|
return template_renderer(["chatelet/templates"])
|
|
|
|
|
|
@chatelet_generic_router.get("/", response_class=HTMLResponse)
|
|
async def index(request: Request, user: User = Depends(check_user_exists)):
|
|
return chatelet_renderer().TemplateResponse(
|
|
"chatelet/index.html", {"request": request, "user": user.json()}
|
|
)
|