All forms using form-floating nicely.
This commit is contained in:
parent
c3ad0fba84
commit
24e49341e8
2 changed files with 25 additions and 25 deletions
|
|
@ -97,20 +97,20 @@ def _fields_for_model(model: str):
|
||||||
"attrs": {"class": "display-6 mb-3"}, "wrap": {"class": "col"}, "label_spec": "{label} ({title})"},
|
"attrs": {"class": "display-6 mb-3"}, "wrap": {"class": "col"}, "label_spec": "{label} ({title})"},
|
||||||
{"name": "buttons", "label": "", "row": "label", "type": "template", "template": "entry_buttons.html",
|
{"name": "buttons", "label": "", "row": "label", "type": "template", "template": "entry_buttons.html",
|
||||||
"wrap": {"class": "col-auto text-end me-2"}, "attrs": {"data-model": model}},
|
"wrap": {"class": "col-auto text-end me-2"}, "attrs": {"data-model": model}},
|
||||||
{"name": "last_name", "label": "Last Name", "label_attrs": {"class": "form-label"},
|
{"name": "last_name", "label": "Last Name", "label_attrs": {"class": "ms-2"},
|
||||||
"attrs": {"placeholder": "Doe", "class": "form-control"}, "row": "name", "wrap": {"class": "col"}},
|
"attrs": {"placeholder": "Doe", "class": "form-control"}, "row": "name", "wrap": {"class": "col form-floating"}},
|
||||||
{"name": "first_name", "label": "First Name", "label_attrs": {"class": "form-label"},
|
{"name": "first_name", "label": "First Name", "label_attrs": {"class": "ms-2"},
|
||||||
"attrs": {"placeholder": "John", "class": "form-control"}, "row": "name", "wrap": {"class": "col"}},
|
"attrs": {"placeholder": "John", "class": "form-control"}, "row": "name", "wrap": {"class": "col form-floating"}},
|
||||||
{"name": "title", "label": "Title", "label_attrs": {"class": "form-label"},
|
{"name": "title", "label": "Title", "label_attrs": {"class": "ms-2"},
|
||||||
"attrs": {"placeholder": "President of the Universe", "class": "form-control"},
|
"attrs": {"placeholder": "President of the Universe", "class": "form-control"},
|
||||||
"row": "name", "wrap": {"class": "col"}},
|
"row": "name", "wrap": {"class": "col form-floating"}},
|
||||||
{"name": "supervisor", "label": "Supervisor", "label_attrs": {"class": "form-label"},
|
{"name": "supervisor", "label": "Supervisor", "label_attrs": {"class": "ms-2 link-label"},
|
||||||
"label_spec": "{label}", "row": "details", "wrap": {"class": "col"},
|
"label_spec": "{label}", "row": "details", "wrap": {"class": "col form-floating"},
|
||||||
"attrs": {"class": "form-control"}, "link": {"endpoint": "entry.entry", "params": {"id": "{supervisor.id}", "model": "user"}},
|
"attrs": {"class": "form-control"}, "link": {"endpoint": "entry.entry", "params": {"id": "{supervisor.id}", "model": "user"}},
|
||||||
"options_params": {"active__eq": True, "staff__eq": True}},
|
"options_params": {"active__eq": True, "staff__eq": True}},
|
||||||
{"name": "location", "label": "Room", "label_attrs": {"class": "form-label"},
|
{"name": "location", "label": "Room", "label_attrs": {"class": "ms-2"},
|
||||||
"label_spec": "{name} - {room_function.description}",
|
"label_spec": "{name} - {room_function.description}",
|
||||||
"row": "details", "wrap": {"class": "col"}, "attrs": {"class": "form-control"}},
|
"row": "details", "wrap": {"class": "col form-floating"}, "attrs": {"class": "form-control"}},
|
||||||
{"name": "active", "label": "Active", "label_attrs": {"class": "form-check-label"},
|
{"name": "active", "label": "Active", "label_attrs": {"class": "form-check-label"},
|
||||||
"row": "checkboxes", "attrs": {"class": "form-check-input"}, "wrap": {"class": "form-check"}},
|
"row": "checkboxes", "attrs": {"class": "form-check-input"}, "wrap": {"class": "form-check"}},
|
||||||
{"name": "staff", "label": "Staff Member", "label_attrs": {"class": "form-check-label"},
|
{"name": "staff", "label": "Staff Member", "label_attrs": {"class": "form-check-label"},
|
||||||
|
|
@ -148,21 +148,21 @@ def _fields_for_model(model: str):
|
||||||
"attrs": {"class": "display-6 mb-3"}, "row": "label", "wrap": {"class": "col"}},
|
"attrs": {"class": "display-6 mb-3"}, "row": "label", "wrap": {"class": "col"}},
|
||||||
{"name": "buttons", "label": "", "row": "label", "type": "template", "template": "entry_buttons.html",
|
{"name": "buttons", "label": "", "row": "label", "type": "template", "template": "entry_buttons.html",
|
||||||
"wrap": {"class": "col-auto text-end me-2"}, "attrs": {"data-model": model}},
|
"wrap": {"class": "col-auto text-end me-2"}, "attrs": {"data-model": model}},
|
||||||
{"name": "contact", "row": "ownership", "wrap": {"class": "col"}, "label": "Contact",
|
{"name": "contact", "row": "ownership", "wrap": {"class": "col form-floating"}, "label": "Contact",
|
||||||
"label_spec": "{label}", "attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"},
|
"label_spec": "{label}", "attrs": {"class": "form-control"}, "label_attrs": {"class": "ms-2 link-label"},
|
||||||
"link": {"endpoint": "entry.entry", "params": {"id": "{contact.id}", "model": "user"}},
|
"link": {"endpoint": "entry.entry", "params": {"id": "{contact.id}", "model": "user"}},
|
||||||
"options_params": {"active__eq": True}},
|
"options_params": {"active__eq": True}},
|
||||||
{"name": "work_item", "row": "ownership", "wrap": {"class": "col"}, "label": "Work Item",
|
{"name": "work_item", "row": "ownership", "wrap": {"class": "col form-floating"}, "label": "Work Item",
|
||||||
"label_spec": "{label}", "attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"},
|
"label_spec": "{label}", "attrs": {"class": "form-control"}, "label_attrs": {"class": "ms-2 link-label"},
|
||||||
"link": {"endpoint": "entry.entry", "params": {"id": "{work_item.id}", "model": "inventory"}},
|
"link": {"endpoint": "entry.entry", "params": {"id": "{work_item.id}", "model": "inventory"}},
|
||||||
"options_params": {"condition__nin": ["Removed", "Disposed"]}},
|
"options_params": {"condition__nin": ["Removed", "Disposed"]}},
|
||||||
{"name": "start_time", "type": "datetime", "attrs": {"class": "form-control"}, "row": "timestamps",
|
{"name": "start_time", "type": "datetime", "attrs": {"class": "form-control"}, "row": "timestamps",
|
||||||
"wrap": {"class": "col"}, "label_attrs": {"class": "form-label"}, "label": "Start"},
|
"wrap": {"class": "col form-floating"}, "label_attrs": {"class": "ms-2"}, "label": "Start"},
|
||||||
{"name": "end_time", "type": "datetime", "attrs": {"class": "form-control"}, "row": "timestamps",
|
{"name": "end_time", "type": "datetime", "attrs": {"class": "form-control"}, "row": "timestamps",
|
||||||
"wrap": {"class": "col"}, "label_attrs": {"class": "form-label"}, "label": "End"},
|
"wrap": {"class": "col form-floating"}, "label_attrs": {"class": "ms-2"}, "label": "End"},
|
||||||
{"name": "complete", "label": "Complete", "label_attrs": {"class": "form-check-label"},
|
{"name": "complete", "label": "Complete", "label_attrs": {"class": "form-check-label"},
|
||||||
"attrs": {"class": "form-check-input"}, "row": "timestamps", "wrap": {"class": "col form-check"}},
|
"attrs": {"class": "form-check-input"}, "row": "timestamps", "wrap": {"class": "col form-check"}},
|
||||||
{"name": "updates", "label": "Updates", "row": "updates", "label_attrs": {"class": "form-label"},
|
{"name": "updates", "label": "Updates", "row": "updates", "label_attrs": {"class": "ms-2"},
|
||||||
"type": "template", "template": "update_list.html"},
|
"type": "template", "template": "update_list.html"},
|
||||||
]
|
]
|
||||||
layout = [
|
layout = [
|
||||||
|
|
@ -182,12 +182,12 @@ def _fields_for_model(model: str):
|
||||||
{"name": "buttons", "label": "", "row": "label", "type": "template", "template": "entry_buttons.html",
|
{"name": "buttons", "label": "", "row": "label", "type": "template", "template": "entry_buttons.html",
|
||||||
"wrap": {"class": "col-auto text-end me-2"}, "attrs": {"data-model": model}},
|
"wrap": {"class": "col-auto text-end me-2"}, "attrs": {"data-model": model}},
|
||||||
{"name": "name", "label": "Name", "row": "name", "attrs": {"class": "form-control"},
|
{"name": "name", "label": "Name", "row": "name", "attrs": {"class": "form-control"},
|
||||||
"label_attrs": {"class": "form-label"}, "wrap": {"class": "col mb-3"}},
|
"label_attrs": {"class": "ms-2"}, "wrap": {"class": "col mb-3 form-floating"}},
|
||||||
{"name": "area", "label": "Area", "row": "details", "attrs": {"class": "form-control"},
|
{"name": "area", "label": "Area", "row": "details", "attrs": {"class": "form-control"},
|
||||||
"label_attrs": {"class": "form-label"}, "wrap": {"class": "col"}, "label_spec": "{name}"},
|
"label_attrs": {"class": "ms-2"}, "wrap": {"class": "col form-floating"}, "label_spec": "{name}"},
|
||||||
{"name": "room_function", "label": "Description", "label_spec": "{description}",
|
{"name": "room_function", "label": "Description", "label_spec": "{description}",
|
||||||
"attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"}, "row": "details",
|
"attrs": {"class": "form-control"}, "label_attrs": {"class": "ms-2"}, "row": "details",
|
||||||
"wrap": {"class": "col"}},
|
"wrap": {"class": "col form-floating"}},
|
||||||
]
|
]
|
||||||
layout = [
|
layout = [
|
||||||
{"name": "label", "order": 0, "attrs": {"class": "row align-items-center"}},
|
{"name": "label", "order": 0, "attrs": {"class": "row align-items-center"}},
|
||||||
|
|
@ -201,9 +201,9 @@ def _fields_for_model(model: str):
|
||||||
{"name": "buttons", "label": "", "row": "label", "type": "template", "template": "entry_buttons.html",
|
{"name": "buttons", "label": "", "row": "label", "type": "template", "template": "entry_buttons.html",
|
||||||
"wrap": {"class": "col-auto text-end me-2"}, "attrs": {"data-model": model}},
|
"wrap": {"class": "col-auto text-end me-2"}, "attrs": {"data-model": model}},
|
||||||
{"name": "description", "row": "details", "label": "Description", "attrs": {"class": "form-control"},
|
{"name": "description", "row": "details", "label": "Description", "attrs": {"class": "form-control"},
|
||||||
"label_attrs": {"class": "form-label"}, "wrap": {"class": "col"}},
|
"label_attrs": {"class": "ms-2"}, "wrap": {"class": "col form-floating"}},
|
||||||
{"name": "category", "row": "details", "label": "Category", "attrs": {"class": "form-control"},
|
{"name": "category", "row": "details", "label": "Category", "attrs": {"class": "form-control"},
|
||||||
"type": "select", "wrap": {"class": "col"}, "label_attrs": {"class": "form-label"}, "options": [
|
"type": "select", "wrap": {"class": "col form-floating"}, "label_attrs": {"class": "ms-2"}, "options": [
|
||||||
{"label": "Active", "value": "Active"},
|
{"label": "Active", "value": "Active"},
|
||||||
{"label": "Available", "value": "Available"},
|
{"label": "Available", "value": "Available"},
|
||||||
{"label": "Pending", "value": "Pending"},
|
{"label": "Pending", "value": "Pending"},
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{% set items = (field.template_ctx.instance.updates or []) %}
|
{% set items = (field.template_ctx.instance.updates or []) %}
|
||||||
|
|
||||||
<div class="mt-3">
|
<div class="mt-3 form-floating">
|
||||||
<label class="form-label">Add update</label>
|
|
||||||
<textarea id="newUpdateInput" class="form-control auto-md" rows="3" placeholder="Write a new update..."></textarea>
|
<textarea id="newUpdateInput" class="form-control auto-md" rows="3" placeholder="Write a new update..."></textarea>
|
||||||
|
<label class="form-label">Add update</label>
|
||||||
<div class="mt-2 d-flex gap-2">
|
<div class="mt-2 d-flex gap-2">
|
||||||
<button type="button" class="btn btn-primary btn-sm" onclick="addNewDraft()">Add</button>
|
<button type="button" class="btn btn-primary btn-sm" onclick="addNewDraft()">Add</button>
|
||||||
<button type="button" class="btn btn-outline-secondary btn-sm" onclick="clearNewDraft()">Clear</button>
|
<button type="button" class="btn btn-outline-secondary btn-sm" onclick="clearNewDraft()">Clear</button>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue