60 lines
No EOL
1.6 KiB
HTML
60 lines
No EOL
1.6 KiB
HTML
<!-- templates/search.html -->
|
|
{% extends "layout.html" %}
|
|
|
|
{% block title %}{{ title }}{% endblock %}
|
|
|
|
{% block content %}
|
|
|
|
{{ breadcrumbs.breadcrumb_header(
|
|
title=title,
|
|
) }}
|
|
|
|
<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 %}
|
|
{% if not results['inventory']['rows'] and not results['users']['rows'] and not results['worklog']['rows'] %}
|
|
<div>There are no results for "{{ query }}".</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 %} |