132 lines
4.6 KiB
Python
132 lines
4.6 KiB
Python
import logging
|
|
|
|
from pathlib import Path
|
|
|
|
from rio import App, Theme, Color, Font, Page, Session
|
|
from from_root import from_root
|
|
|
|
from src.ez_lan_manager import pages, init_services
|
|
from src.ez_lan_manager.types.SessionStorage import SessionStorage
|
|
|
|
logger = logging.getLogger(__name__.split(".")[-1])
|
|
|
|
if __name__ == "__main__":
|
|
theme = Theme.from_colors(
|
|
primary_color=Color.from_hex("ffffff"),
|
|
secondary_color=Color.from_hex("018786"),
|
|
neutral_color=Color.from_hex("1e1e1e"),
|
|
background_color=Color.from_hex("121212"),
|
|
hud_color=Color.from_hex("02dac5"),
|
|
text_color=Color.from_hex("018786"),
|
|
mode="dark",
|
|
corner_radius_small=0,
|
|
corner_radius_medium=0,
|
|
corner_radius_large=0,
|
|
font=Font(from_root("src/ez_lan_manager/assets/fonts/joystix.otf"))
|
|
)
|
|
|
|
services = init_services()
|
|
lan_info = services[2].get_lan_info()
|
|
|
|
async def on_session_start(session: Session) -> None:
|
|
await session.set_title(lan_info.name)
|
|
session.attach(SessionStorage())
|
|
|
|
app = App(
|
|
name="EZ LAN Manager",
|
|
pages=[
|
|
Page(
|
|
name="News",
|
|
page_url="",
|
|
build=pages.NewsPage,
|
|
),
|
|
Page(
|
|
name="News",
|
|
page_url="news",
|
|
build=pages.NewsPage,
|
|
),
|
|
Page(
|
|
name="Overview",
|
|
page_url="overview",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="LAN Übersicht"),
|
|
),
|
|
Page(
|
|
name="BuyTicket",
|
|
page_url="buy_ticket",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Tickets kaufen"),
|
|
),
|
|
Page(
|
|
name="SeatingPlan",
|
|
page_url="seating",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Sitzplan"),
|
|
),
|
|
Page(
|
|
name="Catering",
|
|
page_url="catering",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Catering"),
|
|
),
|
|
Page(
|
|
name="Guests",
|
|
page_url="guests",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Teilnehmer"),
|
|
),
|
|
Page(
|
|
name="Tournaments",
|
|
page_url="tournaments",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Turniere"),
|
|
),
|
|
Page(
|
|
name="FAQ",
|
|
page_url="faq",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="FAQ"),
|
|
),
|
|
Page(
|
|
name="RulesGTC",
|
|
page_url="rules-gtc",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Regeln & AGB"),
|
|
),
|
|
Page(
|
|
name="Contact",
|
|
page_url="contact",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Kontakt"),
|
|
),
|
|
Page(
|
|
name="Imprint",
|
|
page_url="imprint",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Impressum & DSGVO"),
|
|
),
|
|
Page(
|
|
name="Register",
|
|
page_url="register",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Registrierung"),
|
|
),
|
|
Page(
|
|
name="ForgotPassword",
|
|
page_url="forgot-password",
|
|
build=lambda: pages.PlaceholderPage(placeholder_name="Passwort vergessen"),
|
|
)
|
|
],
|
|
theme=theme,
|
|
assets_dir=Path(__file__).parent / "assets",
|
|
default_attachments=services,
|
|
on_session_start=on_session_start,
|
|
icon=from_root("src/ez_lan_manager/assets/img/favicon.png"),
|
|
meta_tags={
|
|
"robots": "INDEX,FOLLOW",
|
|
"description": f"Info und Verwaltungs-Seite der LAN Party '{lan_info.name} - {lan_info.iteration}'.",
|
|
"og:description": f"Info und Verwaltungs-Seite der LAN Party '{lan_info.name} - {lan_info.iteration}'.",
|
|
"keywords": "Gaming, Clan, Guild, Verein, Club, Einfach, Zocken, Genuss, Gesellschaft, Videospiele, "
|
|
"Videogames, LAN, Party, EZ, LAN, Manager",
|
|
"author": "David Rodenkirchen",
|
|
"publisher": "EZ GG e.V.",
|
|
"copyright": "EZ GG e.V.",
|
|
"audience": "Alle",
|
|
"page-type": "Management Application",
|
|
"page-topic": "LAN Party",
|
|
"expires": "",
|
|
"revisit-after": "2 days"
|
|
}
|
|
)
|
|
|
|
app.run_as_web_server()
|