63 lines
2.1 KiB
Python
63 lines
2.1 KiB
Python
from nicegui import ui
|
|
from datetime import datetime
|
|
|
|
# https://www.feuerwehr.hoechst.at/includes/logo.png
|
|
|
|
def build_ui():
|
|
ui.colors(primary='#ce2029') #Firetruck Red
|
|
with ui.card():
|
|
dark = ui.dark_mode(True)
|
|
ui.switch('Dark mode').bind_value(dark)
|
|
|
|
with ui.row().classes("w-full"):
|
|
with ui.card():
|
|
# ATS Träger Dropdown Menü
|
|
ui.label("ATS Träger eintragen")
|
|
traeger = [
|
|
"Tim Grubmüller",
|
|
"Phil Lang",
|
|
"Max Hämmerle",
|
|
]
|
|
ui.select(label="ATS Träger Name", options=traeger, with_input=True, on_change=lambda e: ui.notify(e.value)).classes('w-full')
|
|
|
|
# Einsatzname
|
|
ui.input(label='Einsatzort', placeholder='Adresse, oder Beschreibung').classes("w-full")
|
|
|
|
with ui.row().classes('gap-10'):
|
|
|
|
# --- 3. Der DATUMS-PICKER (Pop-Up) ---
|
|
heute = datetime.now().strftime("%Y-%m-%d")
|
|
|
|
with ui.input('Datum', value=heute).classes('flex-1') as date_input:
|
|
# Das Icon im Eingabefeld (zum Klicken)
|
|
with date_input.add_slot('append'):
|
|
ui.icon('event').classes('cursor-pointer') \
|
|
.on('click', lambda: menu.open()) # Öffnet das Menü
|
|
|
|
# Das Pop-Up Menü mit dem Kalender
|
|
with ui.menu() as menu:
|
|
ui.date().bind_value(date_input)
|
|
|
|
# 'flex-1': Bedeutet "Nimm dir 1 Anteil vom Platz".
|
|
input_zeit = ui.number(label="Dauer (Min)", value=0).classes('flex-1')
|
|
|
|
ui.separator()
|
|
with ui.row().classes('w-full'):
|
|
ui.button(text="Leeren", on_click=ClearForm)
|
|
ui.space()
|
|
ui.button(text="Eintragen", on_click=InputDataToTable)
|
|
|
|
|
|
with ui.card().classes('flex-1 h-[85vh] p-0'):
|
|
ui.label("PLACEHOLDER ##### Datenbankeinträge aus Alten Einsätzen.")
|
|
|
|
|
|
|
|
def InputDataToTable():
|
|
ui.notify("Eintrag in Datenbank erstellt.")
|
|
|
|
def ClearForm():
|
|
ui.notify("Gelöscht.")
|
|
|
|
|