Replace onclick navigation with proper links

Converts cancel buttons that use onclick="window.location.href='...'" to
proper A tags with href. This improves accessibility (keyboard navigation,
right-click options) and semantics while maintaining the same button styling.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-09 12:25:02 +00:00
parent 7315e552e3
commit 803169816b
2 changed files with 6 additions and 8 deletions

View File

@@ -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,

View File

@@ -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)",