feat: add notes field to 7 forms missing it

Added optional notes field to forms that support it in their payloads
but were missing the UI input:
- cohort_form (Create Animal Cohort)
- hatch_form (Record Hatch)
- promote_form (Promote Animal)
- tag_add_form (Add Tag)
- tag_end_form (End Tag)
- attrs_form (Update Attributes)
- move_form (Move Animals)

Uses consistent LabelTextArea pattern matching existing forms like
outcome_form and status_correct_form.

🤖 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-01 13:52:45 +00:00
parent fdbf259182
commit 91d2884ec0
2 changed files with 50 additions and 1 deletions

View File

@@ -268,6 +268,13 @@ def cohort_form(
id="origin", id="origin",
name="origin", name="origin",
), ),
# Optional notes
LabelTextArea(
"Notes",
id="notes",
name="notes",
placeholder="Optional notes",
),
# Event datetime picker (for backdating) # Event datetime picker (for backdating)
event_datetime_field("cohort_datetime", datetime_value, datetime_ts), event_datetime_field("cohort_datetime", datetime_value, datetime_ts),
# Hidden nonce for idempotency # Hidden nonce for idempotency
@@ -386,6 +393,13 @@ def hatch_form(
cls="text-xs text-stone-400 mt-1", cls="text-xs text-stone-400 mt-1",
), ),
), ),
# Optional notes
LabelTextArea(
"Notes",
id="notes",
name="notes",
placeholder="Optional notes",
),
# Event datetime picker (for backdating) # Event datetime picker (for backdating)
event_datetime_field("hatch_datetime"), event_datetime_field("hatch_datetime"),
# Hidden nonce for idempotency # Hidden nonce for idempotency
@@ -498,6 +512,13 @@ def promote_form(
value=traits_value, value=traits_value,
placeholder="Color markings, size, personality...", placeholder="Color markings, size, personality...",
), ),
# Optional notes
LabelTextArea(
"Notes",
id="notes",
name="notes",
placeholder="Optional notes",
),
# Hidden fields # Hidden fields
Hidden(name="animal_id", value=animal.animal_id), Hidden(name="animal_id", value=animal.animal_id),
Hidden(name="nonce", value=str(ULID())), Hidden(name="nonce", value=str(ULID())),
@@ -589,6 +610,13 @@ def tag_add_form(
name="tag", name="tag",
placeholder="Enter tag name", placeholder="Enter tag name",
), ),
# Optional notes
LabelTextArea(
"Notes",
id="notes",
name="notes",
placeholder="Optional notes",
),
# Event datetime picker (for backdating) # Event datetime picker (for backdating)
event_datetime_field("tag_add_datetime"), event_datetime_field("tag_add_datetime"),
# Hidden fields for selection context # Hidden fields for selection context
@@ -778,6 +806,13 @@ def tag_end_form(
P("No active tags on selected animals", cls="text-sm text-stone-400"), P("No active tags on selected animals", cls="text-sm text-stone-400"),
cls="p-3 bg-slate-800 rounded-md", cls="p-3 bg-slate-800 rounded-md",
), ),
# Optional notes
LabelTextArea(
"Notes",
id="notes",
name="notes",
placeholder="Optional notes",
),
# Event datetime picker (for backdating) # Event datetime picker (for backdating)
event_datetime_field("tag_end_datetime"), event_datetime_field("tag_end_datetime"),
# Hidden fields for selection context # Hidden fields for selection context
@@ -991,6 +1026,13 @@ def attrs_form(
id="repro_status", id="repro_status",
name="repro_status", name="repro_status",
), ),
# Optional notes
LabelTextArea(
"Notes",
id="notes",
name="notes",
placeholder="Optional notes",
),
# Event datetime picker (for backdating) # Event datetime picker (for backdating)
event_datetime_field("attrs_datetime"), event_datetime_field("attrs_datetime"),
# Hidden fields for selection context # Hidden fields for selection context

View File

@@ -5,7 +5,7 @@ from collections.abc import Callable
from typing import Any from typing import Any
from fasthtml.common import H2, Div, Form, Hidden, Option, P, Span from fasthtml.common import H2, Div, Form, Hidden, Option, P, Span
from monsterui.all import Alert, AlertT, Button, ButtonT, LabelInput, LabelSelect from monsterui.all import Alert, AlertT, Button, ButtonT, LabelInput, LabelSelect, LabelTextArea
from ulid import ULID from ulid import ULID
from animaltrack.models.reference import Location from animaltrack.models.reference import Location
@@ -103,6 +103,13 @@ def move_form(
id="to_location_id", id="to_location_id",
name="to_location_id", name="to_location_id",
), ),
# Optional notes
LabelTextArea(
"Notes",
id="notes",
name="notes",
placeholder="Optional notes",
),
# Event datetime picker (for backdating) # Event datetime picker (for backdating)
event_datetime_field("move_datetime"), event_datetime_field("move_datetime"),
# Hidden fields for selection context # Hidden fields for selection context