Files
inventory-app/inventory-app/templates/inventory.html
2025-05-31 01:44:13 +03:00

67 lines
1.8 KiB
HTML

{% extends 'base.html' %}
{% block content %}
<div class="container">
{% include "inventory_filter.html" %}
{% macro add_item_button() -%}
<p>
<a class="waves-effect waves-light btn" href="/m/inventory/add">Add item</a>
</p>
{%- endmacro %}
{{ add_item_button() }}
<table>
<thead>
<tr>
<th>Sticker</th>
<th>Visibility</th>
<th>Type</th>
<th>Name</th>
<th>Location</th>
<th>Owner</th>
<th>User</th>
{% if can_audit %}
<th>Audit</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for item in items %}
<tr {% if item | check_foreign_key_format %}
style="background-color: coral;"
{% endif %}
>
<td>
{% if item.shortener %}
<a href="http://k6.ee/{{ item.shortener.slug }}">{{ item.shortener.slug }}</a>
{% endif %}
</td>
<td>{{ item.inventory.visibility }}</td>
<td>{{ item.type }}</td>
<td><a href="/m/inventory/{{ item._id }}/view">{{ item | format_name }}</a> {{ item.comment }}</td>
<td>{{ item.location }}</td>
<td>{{ item | owner_link }}</td>
<td>{{ item | user_link }}</td>
{% if can_audit %}
<td>
<form onsubmit="return false;">
<button
data-item-id="{{ item._id }}"
class="audit-button {{ item.inventory | audit_color }} waves-effect waves-light btn"
>
{{item.inventory | audit_text}}
</button>
</form>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
{{ add_item_button() }}
</div>
{% endblock %}