Fotofunktion für Touchscreen

und Grid Funktion für Touchscreen
This commit is contained in:
Alexander Malzkuhn 2025-04-18 17:59:20 +02:00
parent 9936f30f50
commit 1a9e4aea14
2 changed files with 25 additions and 10 deletions

BIN
users/testuser2/photo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

View File

@ -26,20 +26,35 @@ def page_touchscreen():
ui.notify(status_out)
ui.markdown(f"##{app_title} {app_version}")
ui.html('<center>')
userlist = list_users()
number_of_users = len(userlist)
buttons = { }
for name in userlist:
current_user = user(name)
current_button = ui.button(current_user.fullname, on_click=lambda name=name: button_click(name))
if current_user.stamp_status() == status_in:
current_button.props('color=green')
else:
current_button.props('color=red')
buttons[name] = current_button
ui.html("</center>")
if number_of_users > 5:
number_of_columns = 5
else:
number_of_columns = number_of_users
with ui.grid(columns=number_of_columns):
for name in userlist:
current_user = user(name)
current_button = ui.button(on_click=lambda name=name: button_click(name))
with current_button:
try:
with open(current_user.photofile, 'r') as file:
pass
file.close()
ui.image(current_user.photofile)
except:
pass
ui.label(current_user.fullname)
if current_user.stamp_status() == status_in:
current_button.props('color=green')
else:
current_button.props('color=red')
buttons[name] = current_button
@ui.page('/userlist')