Merge branch 'styling'
This commit is contained in:
commit
6f4cbefc02
22
lib/admin.py
22
lib/admin.py
@ -1077,8 +1077,11 @@ def page_admin():
|
||||
|
||||
workhours_select.clear()
|
||||
workhour_list = list(current_user.workhours)
|
||||
workhour_dict = { }
|
||||
for i in workhour_list:
|
||||
workhour_dict[i] = datetime.datetime.strptime(i, "%Y-%m-%d").strftime("%d.%m.%Y")
|
||||
workhour_list.sort()
|
||||
workhours_select.set_options(workhour_list)
|
||||
workhours_select.set_options(workhour_dict)
|
||||
workhours_select.value = workhour_list[0]
|
||||
workinghourscard.visible = True
|
||||
|
||||
@ -1195,7 +1198,12 @@ def page_admin():
|
||||
current_user.write_settings()
|
||||
workhour_list = list(current_user.workhours)
|
||||
workhours_select.clear()
|
||||
workhours_select.set_options(workhour_list)
|
||||
workhour_dict = {}
|
||||
for i in workhour_list:
|
||||
workhour_dict[i] = datetime.datetime.strptime(i, "%Y-%m-%d").strftime(
|
||||
"%d.%m.%Y")
|
||||
workhours_select.set_options(workhour_dict)
|
||||
workhours_select.set_options(workhour_dict)
|
||||
workhours_select.set_value(workhour_list[-1])
|
||||
|
||||
#workhours_selection_changed(current_user.workhours[0])
|
||||
@ -1205,7 +1213,7 @@ def page_admin():
|
||||
with ui.dialog() as dialog, ui.card():
|
||||
current_user = user(user_selection.value)
|
||||
if len(current_user.workhours) > 1:
|
||||
ui.label(f"Soll der Eintrag *{workhours_select.value}* wirklich gelöscht werden?")
|
||||
ui.label(f"Soll der Eintrag {datetime.datetime.strptime(workhours_select.value, '%Y-%m-%d').strftime('%d.%m.%Y')} wirklich gelöscht werden?")
|
||||
ui.label("Dies kann nicht rückgängig gemacht werden.").classes('text-bold')
|
||||
with ui.row():
|
||||
ui.button("Löschen", on_click=delete_entry)
|
||||
@ -1363,7 +1371,7 @@ def page_admin():
|
||||
|
||||
def add_workhours_entry():
|
||||
workhours_dict = { }
|
||||
for i in range(7):
|
||||
for i in range(1, 8):
|
||||
workhours_dict[i] = 0
|
||||
workhours_dict["vacation"] = 0
|
||||
current_user.workhours[date_picker.value] = workhours_dict
|
||||
@ -1372,7 +1380,11 @@ def page_admin():
|
||||
workhours_select.clear()
|
||||
workhours_list = list(current_user.workhours)
|
||||
workhours_list.sort()
|
||||
workhours_select.set_options(workhours_list)
|
||||
workhour_dict = {}
|
||||
for i in workhours_list:
|
||||
workhour_dict[i] = datetime.datetime.strptime(i, "%Y-%m-%d").strftime(
|
||||
"%d.%m.%Y")
|
||||
workhours_select.set_options(workhour_dict)
|
||||
workhours_select.value = date_picker.value
|
||||
|
||||
dialog.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user