This commit is contained in:
@@ -73,7 +73,7 @@ class NewMedicineState(rx.State):
|
||||
self.load_last_scan()
|
||||
|
||||
@rx.var
|
||||
def owners(self) -> List[str]:
|
||||
def owners(self) -> list[str]:
|
||||
with rx.session() as session:
|
||||
statement = select(Owner)
|
||||
results = session.exec(statement)
|
||||
@@ -185,32 +185,31 @@ def new_medicine_form():
|
||||
|
||||
|
||||
def taken_form():
|
||||
with rx.session() as session:
|
||||
if NewMedicineState.medicine is None:
|
||||
return rx.vstack()
|
||||
if NewMedicineState.medicine is None:
|
||||
return rx.vstack()
|
||||
|
||||
return rx.vstack(
|
||||
rx.heading(NewMedicineState.medicine_name, size="lg", color="darkblue"),
|
||||
rx.hstack(
|
||||
rx.form(
|
||||
rx.button("Ja", type_="submit", color_scheme="green", size="lg"),
|
||||
rx.input(
|
||||
value=NewMedicineState.last_scan_uuid,
|
||||
name="uuid",
|
||||
disabled=True,
|
||||
hidden=True,
|
||||
type_="hidden",
|
||||
),
|
||||
on_submit=NewMedicineState.handle_log,
|
||||
return rx.vstack(
|
||||
rx.heading(NewMedicineState.medicine_name, size="lg", color="darkblue"),
|
||||
rx.hstack(
|
||||
rx.form(
|
||||
rx.button("Ja", type_="submit", color_scheme="green", size="lg"),
|
||||
rx.input(
|
||||
value=NewMedicineState.last_scan_uuid,
|
||||
name="uuid",
|
||||
disabled=True,
|
||||
hidden=True,
|
||||
type_="hidden",
|
||||
),
|
||||
rx.form(
|
||||
rx.button("Nein", type_="submit", color_scheme="red", size="lg"),
|
||||
on_submit=NewMedicineState.cancel_log,
|
||||
),
|
||||
reset_on_submit=True,
|
||||
on_submit=NewMedicineState.handle_log,
|
||||
),
|
||||
rx.divider(),
|
||||
)
|
||||
rx.form(
|
||||
rx.button("Nein", type_="submit", color_scheme="red", size="lg"),
|
||||
on_submit=NewMedicineState.cancel_log,
|
||||
),
|
||||
reset_on_submit=True,
|
||||
),
|
||||
rx.divider(),
|
||||
)
|
||||
|
||||
def just_show(x):
|
||||
return rx.text(x)
|
||||
|
||||
Reference in New Issue
Block a user