Added Layout and UserProfile

This commit is contained in:
2025-11-10 21:19:38 +01:00
parent a547b2b882
commit d302261d07
12 changed files with 249 additions and 87 deletions

View File

@@ -1,6 +1,7 @@
import logging
from fasthtml import serve
from fasthtml.components import *
from myfasthtml.controls.Layout import Layout
from myfasthtml.myfastapp import create_app
@@ -11,13 +12,26 @@ logging.basicConfig(
datefmt='%Y-%m-%d %H:%M:%S', # Timestamp format
)
app, rt = create_app(protect_routes=False, mount_auth_app=True, pico=False, title="MyFastHtml" )
app, rt = create_app(protect_routes=True,
mount_auth_app=True,
pico=False,
title="MyFastHtml",
live=True,
base_url="http://localhost:5003")
@rt("/")
def index(session):
layout = Layout(session, "Testing Layout", right_drawer=False)
layout = Layout(session, "Testing Layout")
layout.set_footer("Goodbye World")
for i in range(1000):
layout.left_drawer.append(Div(f"Left Drawer Item {i}"))
content = tuple([Div(f"Content {i}") for i in range(1000)])
layout.set_main(content)
return layout
if __name__ == "__main__":
# debug_routes(app)
serve(port=5003)