62 lines
No EOL
1.8 KiB
HTML
62 lines
No EOL
1.8 KiB
HTML
<!-- templates/search.html -->
|
|
{% extends "layout.html" %}
|
|
|
|
{% block title %}{{ title }}{% endblock %}
|
|
|
|
{% block precontent %}
|
|
{{ toolbars.render_toolbar(
|
|
id='search',
|
|
left = breadcrumb_macro.render_breadcrumb(breadcrumbs=breadcrumbs)
|
|
) }}
|
|
{% if not results['inventory']['rows'] and not results['users']['rows'] and not results['worklog']['rows'] %}
|
|
<div class="alert alert-danger rounded-0">There are no results for "{{ query }}".</div>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="container">
|
|
{% if results['inventory']['rows'] %}
|
|
<div>
|
|
{{ tables.render_table(
|
|
headers = results['inventory']['headers'],
|
|
rows = results['inventory']['rows'],
|
|
entry_route = 'inventory_item',
|
|
title='Inventory Results',
|
|
id='search-inventory'
|
|
)}}
|
|
</div>
|
|
{% endif %}
|
|
{% if results['users']['rows'] %}
|
|
<div>
|
|
{{ tables.render_table(
|
|
headers = results['users']['headers'],
|
|
rows = results['users']['rows'],
|
|
entry_route = 'user',
|
|
title='User Results',
|
|
id='search-users'
|
|
)}}
|
|
</div>
|
|
{% endif %}
|
|
{% if results['worklog']['rows'] %}
|
|
<div>
|
|
{{ tables.render_table(
|
|
headers = results['worklog']['headers'],
|
|
rows = results['worklog']['rows'],
|
|
entry_route = 'worklog_entry',
|
|
title='Worklog Results',
|
|
id='search-worklog'
|
|
)}}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block script %}
|
|
{% if query and (results['inventory']['rows'] or results['users']['rows'] or results['worklog']['rows']) %}
|
|
const query = "{{ query|e }}";
|
|
if (query) {
|
|
const instance = new Mark(document.querySelector("main"));
|
|
instance.mark(query);
|
|
}
|
|
{% endif %}
|
|
{% endblock %} |