miniweb/templates/admin/items/item_list.jinja

59 lines
1.4 KiB
Django/Jinja

{% extends "admin/base.jinja" %}
{% block content %}
{% block search_bar %}
<div class="ui icon input">
<input type="text" placeholder="Search...">
<i class="circular search link icon"></i>
</div>
{% endblock %}
{% if item_list %}
{% set item_keys = item_info.display_list or item_list|table_keys %}
{% if item_info.lookup_key in item_keys %}
{% set primary_key = item_info.lookup_key %}
{% endif %}
<div class="ui short scrolling container">
<table class="ui very compact celled table head stuck unstackable">
<caption>{{ item_info.name|none(content) }}</caption>
<thead>
<tr>
{% for key in item_keys %}
{% if key==primary_key %}
<th class="blue"><i class="key icon"></i>
{{ key|capitalize }}
</th>
{% else %}
<th>{{ key|capitalize }}</th>
{% endif %}
{% endfor %}
</tr>
</thead>
<tbody>
{% for item in item_list %}
<tr>
{% for key in item_keys %}
{% if key==primary_key %}
<td class="selectable warning">
<a href="#">{{ item[key] }}</a>
</td>
{% else %}
<td>{{ item[key] }}</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
<tfoot>
</tfoot>
</table>
</div>
{% else %}
No Items found.
{% endif %}
{% endblock content %}