You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
1.6 KiB
77 lines
1.6 KiB
{% extends "_layout" %}
|
|
{% import "_form_macros" as form %}
|
|
|
|
{% block title -%}
|
|
Inventory
|
|
{%- endblock %}
|
|
|
|
{% block nav -%}
|
|
<a href="/add">Add</a>
|
|
<a href="/maintenance/reindex" onclick="return confirm('Unused learned tags and options will be forgotten. Proceed?')">Re-index</a>
|
|
{%- endblock %}
|
|
|
|
{% block content -%}
|
|
COUNT {{count}}
|
|
|
|
<table class="cards-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Actions</th>
|
|
{%- for field in fields %}
|
|
<th>{{ field.label }}</th>
|
|
{%- endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{%- for card in cards %}
|
|
<tr>
|
|
<td class="actions">
|
|
<a href="/edit/{{card.id}}">Edit</a>
|
|
<a href="/delete/{{card.id}}" onclick="return confirm('Delete card?')">Delete</a>
|
|
</td>
|
|
{%- for field in card.fields %}
|
|
{%- if field.kind == "bool" -%}
|
|
<td>
|
|
{% if field.checked %}
|
|
✔
|
|
{% else %}
|
|
✘
|
|
{% endif %}
|
|
</td>
|
|
|
|
{%- elif field.kind == "tags" or field.kind == "free_tags" -%}
|
|
<td class="tags">
|
|
{% for tag in field.tags %}
|
|
<span class="tag">{{ tag }}</span>
|
|
{% endfor %}
|
|
</td>
|
|
|
|
{%- else -%}
|
|
<td>
|
|
{{ field.value }}
|
|
</td>
|
|
{%- endif -%}
|
|
{%- endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
<nav class="paginate">
|
|
{% if pages > 1 %}
|
|
{% if page > 0 %}
|
|
<a href="/?page={{ page - 1 }}">«</a>
|
|
{% else %}
|
|
<span class="disabled">«</span>
|
|
{% endif %}
|
|
|
|
<span class="num" onclick="location.href='/?page='+(prompt('Page')-1);">{{ page + 1 }} of {{ pages }}</span>
|
|
|
|
{% if page < pages - 1 %}
|
|
<a href="/?page={{ page + 1 }}">»</a>
|
|
{% else %}
|
|
<span class="disabled">»</span>
|
|
{% endif %}
|
|
{% endif %}
|
|
</nav>
|
|
{%- endblock %}
|
|
|