diff --git a/src/animaltrack/web/templates/actions.py b/src/animaltrack/web/templates/actions.py index 47dbfb7..a63ac2a 100644 --- a/src/animaltrack/web/templates/actions.py +++ b/src/animaltrack/web/templates/actions.py @@ -4,7 +4,7 @@ from collections.abc import Callable from typing import Any -from fasthtml.common import H2, H3, Div, Form, Hidden, Input, Option, P, Script, Select, Span +from fasthtml.common import H2, H3, A, Div, Form, Hidden, Input, Option, P, Script, Select, Span from monsterui.all import ( Alert, AlertT, @@ -86,11 +86,10 @@ def diff_confirmation_panel( Hidden(name="confirmed", value="true"), Hidden(name="nonce", value=str(ULID())), Div( - Button( + A( "Cancel", - type="button", + href=cancel_url, cls=ButtonT.default, - onclick=f"window.location.href='{cancel_url}'", ), Button( confirm_button_text, diff --git a/src/animaltrack/web/templates/move.py b/src/animaltrack/web/templates/move.py index b96eebc..2df919d 100644 --- a/src/animaltrack/web/templates/move.py +++ b/src/animaltrack/web/templates/move.py @@ -4,7 +4,7 @@ from collections.abc import Callable from typing import Any -from fasthtml.common import H2, Div, Form, Hidden, Option, P, Select, Span +from fasthtml.common import H2, A, Div, Form, Hidden, Option, P, Select, Span from monsterui.all import Alert, AlertT, Button, ButtonT, FormLabel, LabelInput, LabelTextArea from ulid import ULID @@ -253,11 +253,10 @@ def diff_panel( Hidden(name="confirmed", value="true"), Hidden(name="nonce", value=str(ULID())), Div( - Button( + A( "Cancel", - type="button", + href="/move", cls=ButtonT.default, - onclick="window.location.href='/move'", ), Button( f"Confirm Move ({diff.server_count} animals)",