PyTaxonomies/website/templates/search.html

60 lines
1.6 KiB
HTML

{% extends "main.html" %}
{% block title %}Search{% endblock %}
{% block content %}
<div class="container">
<h1>Search {% if query %} - {{query}} {%endif%}</h1>
<form class="form-inline" action="search" method=post>
{{ form.csrf_token }}
{{ form.query(size=20) }}
{{ form.submit }}
</form>
</br>
<div>
{% if query and not entries %}
Nothing found
{%endif%}
{% if entries %}
<table class="table table-striped table-bordered" id="pytaxonomies_table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Machinetag</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Name</th>
<th>Description</th>
<th>Machinetag</th>
</tr>
</tfoot>
<tbody>
{% for mt, val in entries.items() %}
<tr>
<td><a href="{{ url_for('taxonomies', name=val[0].name) }}">{{ val[0].name }}</a></td>
<td>
{% if val|length == 3 %}
{% if val[2].description %}
{{ val[2].description }}
{% elif val[2].expanded %}
{{ val[2].expanded }}
{%endif%}
{% elif val[1].description %}
{{ val[1].description }}
{% else %}
{{ val[1].predicate }}
{%endif%}
</td>
<td>{{ mt }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{%endif%}
</div>
</div>
{% endblock %}