PyTaxonomies/website/templates/search.html

60 lines
1.6 KiB
HTML
Raw Permalink Normal View History

{% extends "main.html" %}
{% block title %}Search{% endblock %}
{% block content %}
<div class="container">
<h1>Search {% if query %} - {{query}} {%endif%}</h1>
2016-10-12 16:35:54 +02:00
<form class="form-inline" action="search" method=post>
{{ form.csrf_token }}
{{ form.query(size=20) }}
2016-10-13 17:23:10 +02:00
{{ 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 %}
2016-10-12 16:35:54 +02:00
{{ val[2].description }}
{% elif val[2].expanded %}
2016-10-12 16:35:54 +02:00
{{ val[2].expanded }}
{%endif%}
{% elif val[1].description %}
2016-10-12 16:35:54 +02:00
{{ val[1].description }}
{% else %}
{{ val[1].predicate }}
{%endif%}
</td>
<td>{{ mt }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{%endif%}
</div>
</div>
{% endblock %}