Flat file database editor and browser with web interface
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.
 
 
rocket-inv/templates/index.html.tera

65 lines
1.4 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 -%}
<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 %}
<td>
{%- if field.kind == "bool" -%}
{% if field.checked %}
{% else %}
{% endif %}
{%- else -%}
{{ field.value }}
{%- endif -%}
</td>
{%- 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 %}