More features for search.
This commit is contained in:
parent
9a39ae25df
commit
3a9dd7b915
3 changed files with 8 additions and 3 deletions
|
|
@ -840,6 +840,9 @@ def _format_value(val: Any, fmt: Optional[str]) -> Any:
|
|||
if fmt is None:
|
||||
return val
|
||||
try:
|
||||
if callable(fmt):
|
||||
return fmt(val)
|
||||
|
||||
if fmt == "yesno":
|
||||
return "Yes" if bool(val) else "No"
|
||||
if fmt == "date":
|
||||
|
|
|
|||
|
|
@ -72,7 +72,8 @@ def init_search_routes(app):
|
|||
"link": {"endpoint": "entry.entry", "params": {"id": "{work_item.id}", "model": "inventory"}}},
|
||||
{"field": "complete", "format": "yesno"},
|
||||
{"field": "start_time", "format": "datetime"},
|
||||
{"field": "end_time", "format": "datetime"}
|
||||
{"field": "end_time", "format": "datetime"},
|
||||
{"field": "updates", "format": lambda x: len(x)},
|
||||
]
|
||||
worklog_results = worklog_service.list({
|
||||
'contact.label|work_item.label__icontains': q,
|
||||
|
|
@ -81,7 +82,8 @@ def init_search_routes(app):
|
|||
"work_item.label",
|
||||
"complete",
|
||||
"start_time",
|
||||
"end_time"
|
||||
"end_time",
|
||||
"updates",
|
||||
]
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{% block main %}
|
||||
<div class="display-4 mb-3 text-center">
|
||||
Search results for "{{ q }}"
|
||||
Search Results For "{{ q }}"
|
||||
</div>
|
||||
<ul class="nav nav-pills nav-fill justify-content-center fw-bold px-5 mx-5 mb-3" id="resultsTab">
|
||||
<li class="nav-item">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue