Working on Work Log entry settings now.
This commit is contained in:
parent
15d0de44fe
commit
86c4f88b78
5 changed files with 89 additions and 7 deletions
|
|
@ -23,8 +23,7 @@ def init_entry_routes(app):
|
|||
if model == "inventory":
|
||||
fields["fields"] = ["label", "name", "serial", "barcode", "brand", "model", "device_type", "owner", "location", "condition", "image"]
|
||||
fields_spec = [
|
||||
{"name": "label", "type": "display", "label": "",
|
||||
"label_attrs": {"class": "display-6 me-2"}, "row": "label",
|
||||
{"name": "label", "type": "display", "label": "", "row": "label",
|
||||
"attrs": {"class": "display-6 mb-3"}},
|
||||
|
||||
{"name": "name", "row": "names", "label": "Name", "wrap": {"class": "col-3"},
|
||||
|
|
@ -65,8 +64,7 @@ def init_entry_routes(app):
|
|||
elif model.lower() == 'user':
|
||||
fields["fields"] = ["label", "first_name", "last_name", "title", "active", "staff", "location", "supervisor"]
|
||||
fields_spec = [
|
||||
{"name": "label", "row": "label", "label": "",
|
||||
"label_attrs": {"class": "display-6 me-2"}, "type": "display",
|
||||
{"name": "label", "row": "label", "label": "", "type": "display",
|
||||
"attrs": {"class": "display-6 mb-3"}},
|
||||
|
||||
{"name": "last_name", "label": "Last Name", "label_attrs": {"class": "form-label"},
|
||||
|
|
@ -102,7 +100,33 @@ def init_entry_routes(app):
|
|||
{"name": "checkboxes", "order": 30, "parent": "name", "attrs": {"class": "col d-flex flex-column justify-content-end"}}
|
||||
]
|
||||
elif model == "worklog":
|
||||
pass
|
||||
fields["fields"] = ["id", "contact", "work_item", "start_time", "end_time", "complete"]
|
||||
fields_spec = [
|
||||
{"name": "id", "label": "", "type": "display", "label_spec": "Work Item #{id}",
|
||||
"attrs": {"class": "display-6 mb-3"}, "row": "label"},
|
||||
|
||||
{"name": "contact", "row": "ownership", "wrap": {"class": "col"}, "label": "Contact",
|
||||
"label_spec": "{first_name} {last_name}", "attrs": {"class": "form-control"},
|
||||
"label_attrs": {"class": "form-label"}},
|
||||
{"name": "work_item", "row": "ownership", "wrap": {"class": "col"}, "label": "Work Item",
|
||||
"label_spec": "{name}", "attrs": {"class": "form-control"}, "label_attrs": {"class": "form-label"}},
|
||||
|
||||
{"name": "start_time", "type": "datetime", "attrs": {"class": "form-control"}, "row": "timestamps",
|
||||
"wrap": {"class": "col"}, "label_attrs": {"class": "form-label"}},
|
||||
{"name": "end_time", "type": "datetime", "attrs": {"class": "form-control"}, "row": "timestamps",
|
||||
"wrap": {"class": "col"}, "label_attrs": {"class": "form-label"}},
|
||||
{"name": "complete", "label": "Complete", "label-attrs": {"class": "form-check-label"},
|
||||
"attrs": {"class": "form-check-input"}, "row": "timestamps", "wrap": {"class": "col form-check"}},
|
||||
|
||||
{"name": "updates", "label": "Updates", "row": "updates", "label_attrs": {"class": "form-label"},
|
||||
"type": "template", "template": "update_list.html"}
|
||||
]
|
||||
layout = [
|
||||
{"name": "label", "order": 0},
|
||||
{"name": "ownership", "order": 10, "attrs": {"class": "row"}},
|
||||
{"name": "timestamps", "order": 20, "attrs": {"class": "row d-flex align-items-center"}},
|
||||
{"name": "updates", "order": 30, "attrs": {"class": "row"}}
|
||||
]
|
||||
|
||||
obj = crudkit.crud.get_service(cls).get(id, fields)
|
||||
if obj is None:
|
||||
|
|
|
|||
|
|
@ -63,9 +63,9 @@ def init_index_routes(app):
|
|||
columns = [
|
||||
{"field": "start_time", "label": "Start", "format": "date"},
|
||||
{"field": "contact.label", "label": "Contact",
|
||||
"link": {"endpoint": "user.get_item", "params": {"id": "{contact.id}"}}},
|
||||
"link": {"endpoint": "entry.entry", "params": {"id": "{contact.id}", "model": "user"}}},
|
||||
{"field": "work_item.label", "label": "Work Item",
|
||||
"link": {"endpoint": "inventory.get_item", "params": {"id": "{work_item.id}"}}},
|
||||
"link": {"endpoint": "entry.entry", "params": {"id": "{work_item.id}", "model": "inventory"}}},
|
||||
{"field": "work_item.device_type.description", "label": "Device Type"}
|
||||
]
|
||||
|
||||
|
|
|
|||
3
inventory/templates/update_list.html
Normal file
3
inventory/templates/update_list.html
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<div class="col mt-3">
|
||||
UPDATES NOT IMPLEMENTED YET
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue