Fotofunktion für Touchscreen
und Grid Funktion für Touchscreen
This commit is contained in:
parent
9936f30f50
commit
1a9e4aea14
BIN
users/testuser2/photo.jpg
Normal file
BIN
users/testuser2/photo.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 550 KiB |
21
web_ui.py
21
web_ui.py
@ -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 = { }
|
||||
|
||||
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(current_user.fullname, on_click=lambda name=name: button_click(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.html("</center>")
|
||||
|
||||
|
||||
@ui.page('/userlist')
|
||||
|
Loading…
x
Reference in New Issue
Block a user