Improving form.

This commit is contained in:
Yaro Kasear 2025-10-03 14:03:43 -05:00
parent 21a3399ecd
commit 4afddf3ee6
2 changed files with 20 additions and 3 deletions

View file

@ -40,8 +40,19 @@ def _fields_for_model(model: str):
{"name": "location", "row": "status", "label": "Location", "wrap": {"class": "col"},
"attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"},
"label_spec": "{name} - {room_function.description}"},
{"name": "condition", "row": "status", "label": "Condition", "wrap": {"class": "col"},
"attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"}},
# {"name": "condition", "row": "status", "label": "Condition", "wrap": {"class": "col"},
# "attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"}},
{"name": "condition", "label": "Condition", "row": "status", "wrap": {"class": "col"},
"type": "select", "options": [
{"label": "Deployed", "value": "Deployed"},
{"label": "Working", "value": "Working"},
{"label": "Unverified", "value": "Unverified"},
{"label": "Partially Inoperable", "value": "Partially Inoperable"},
{"label": "Inoperable", "value": "Inoperable"},
{"label": "Removed", "value": "Removed"},
{"label": "Disposed", "value": "Disposed"},
],
"label_attrs": {"class": "form-label"}, "attrs": {"class": "form-control"}},
{"name": "image", "label": "", "row": "image", "type": "template", "label_spec": "{filename}",
"template": "image_display.html", "attrs": {"class": "img-fluid img-thumbnail h-auto"},
"wrap": {"class": "h-100 w-100"}},