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:
@@ -268,6 +268,13 @@ def cohort_form(
|
||||
id="origin",
|
||||
name="origin",
|
||||
),
|
||||
# Optional notes
|
||||
LabelTextArea(
|
||||
"Notes",
|
||||
id="notes",
|
||||
name="notes",
|
||||
placeholder="Optional notes",
|
||||
),
|
||||
# Event datetime picker (for backdating)
|
||||
event_datetime_field("cohort_datetime", datetime_value, datetime_ts),
|
||||
# Hidden nonce for idempotency
|
||||
@@ -386,6 +393,13 @@ def hatch_form(
|
||||
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_field("hatch_datetime"),
|
||||
# Hidden nonce for idempotency
|
||||
@@ -498,6 +512,13 @@ def promote_form(
|
||||
value=traits_value,
|
||||
placeholder="Color markings, size, personality...",
|
||||
),
|
||||
# Optional notes
|
||||
LabelTextArea(
|
||||
"Notes",
|
||||
id="notes",
|
||||
name="notes",
|
||||
placeholder="Optional notes",
|
||||
),
|
||||
# Hidden fields
|
||||
Hidden(name="animal_id", value=animal.animal_id),
|
||||
Hidden(name="nonce", value=str(ULID())),
|
||||
@@ -589,6 +610,13 @@ def tag_add_form(
|
||||
name="tag",
|
||||
placeholder="Enter tag name",
|
||||
),
|
||||
# Optional notes
|
||||
LabelTextArea(
|
||||
"Notes",
|
||||
id="notes",
|
||||
name="notes",
|
||||
placeholder="Optional notes",
|
||||
),
|
||||
# Event datetime picker (for backdating)
|
||||
event_datetime_field("tag_add_datetime"),
|
||||
# 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"),
|
||||
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_field("tag_end_datetime"),
|
||||
# Hidden fields for selection context
|
||||
@@ -991,6 +1026,13 @@ def attrs_form(
|
||||
id="repro_status",
|
||||
name="repro_status",
|
||||
),
|
||||
# Optional notes
|
||||
LabelTextArea(
|
||||
"Notes",
|
||||
id="notes",
|
||||
name="notes",
|
||||
placeholder="Optional notes",
|
||||
),
|
||||
# Event datetime picker (for backdating)
|
||||
event_datetime_field("attrs_datetime"),
|
||||
# Hidden fields for selection context
|
||||
|
||||
@@ -5,7 +5,7 @@ from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
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 animaltrack.models.reference import Location
|
||||
@@ -103,6 +103,13 @@ def move_form(
|
||||
id="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_field("move_datetime"),
|
||||
# Hidden fields for selection context
|
||||
|
||||
Reference in New Issue
Block a user