29 lines
1.2 KiB
Python
29 lines
1.2 KiB
Python
from nicegui import ui, app
|
|
|
|
def setup_statistic_routes():
|
|
|
|
# 1. Die {}-Klammern definieren eine dynamische Variable in der URL
|
|
@ui.page('/statistic/{systemname}')
|
|
def gamesystem_statistic_page(systemname: str): # <--- WICHTIG: Hier fangen wir das Wort aus der URL auf!
|
|
|
|
# Sicherheitscheck: Ist der User eingeloggt?
|
|
if not app.storage.user.get('authenticated', False):
|
|
ui.navigate.to('/')
|
|
return
|
|
|
|
ui.dark_mode(True)
|
|
|
|
# 2. Seite aufbauen
|
|
with ui.column().classes('w-full items-center mt-10'):
|
|
# Hier nutzen wir die Variable 'systemname', um den Titel anzupassen
|
|
ui.label(f'Deine Statistik in {systemname}').classes('text-3xl font-bold text-blue-400')
|
|
|
|
with ui.card().classes('w-full max-w-2xl mt-6 p-6 items-center'):
|
|
ui.label('Hier laden wir im nächsten Schritt die Daten aus der player_game_statistic Tabelle!').classes('text-gray-400')
|
|
|
|
# Platzhalter für später:
|
|
ui.label('Winrate: -- %').classes('text-xl mt-4')
|
|
ui.label('Durchschnittspunkte: --').classes('text-xl')
|
|
|
|
ui.button('Zurück zur Übersicht', on_click=lambda: ui.navigate.to('/')).classes('mt-8 bg-gray-600 text-white')
|