48 lines
No EOL
2.1 KiB
HTML
48 lines
No EOL
2.1 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block main %}
|
|
<h1 class="display-4 text-center mb-3">Inventory Summary</h1>
|
|
<div class="table-responsive mx-5 overflow-y-auto border" style="max-height: 70vh;">
|
|
<table class="table table-sm table-striped table-hover table-bordered align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th class="text-nowrap position-sticky top-0 bg-body border">Device Type</th>
|
|
{% for col in col_headers %}
|
|
{% if col.href %}
|
|
<th class="text-end position-sticky top-0 bg-body border"><a
|
|
class="link-dark link-underline link-underline-opacity-0" href="{{ col.href }}">{{ col.label }}</a></th>
|
|
{% else %}
|
|
<th class="text-end position-sticky top-0 bg-body border">{{ col.label }}</th>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for row in table_rows %}
|
|
{% set need_more = (row['cells'][-2]['value'] | int > 0) %}
|
|
<tr
|
|
class="{% if need_more %}table-warning{% endif %}{% if loop.index == table_rows|length %} position-sticky bottom-0 border{% endif %}">
|
|
<th class="text-nowrap{% if loop.index == table_rows|length %} position-sticky bottom-0 border{% endif %}">
|
|
{% if row.href %}
|
|
<a class="link-dark link-underline link-underline-opacity-0" href="{{ row.href }}">{{ row.label }}</a>
|
|
{% else %}
|
|
{{ row.label }}
|
|
{% endif %}
|
|
</th>
|
|
{% for cell in row.cells %}
|
|
{% if cell.href %}
|
|
<td
|
|
class="text-end{% if need_more and loop.index == (row.cells|length - 1) %} fw-bold{% endif %}{% if loop.index == table_rows|length %} position-sticky bottom-0 border{% endif %}">
|
|
<a class="link-dark link-underline link-underline-opacity-0" href="{{ cell.href }}">{{ cell.value }}</a></td>
|
|
{% else %}
|
|
<td
|
|
class="text-end{% if need_more and loop.index == (row.cells|length - 1) %} fw-bold{% endif %}{% if loop.index == table_rows|length %} position-sticky bottom-0 border{% endif %}">
|
|
{{ cell.value }}</td>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endblock %} |