{% extends "base.html" %} {% block title %}Devices – Location Management{% endblock %} {% block content %} {# ── Collect grouped data ─────────────────────────────────────────────────── #} {% set named_areas = [] %} {% for d in devices %} {% if d.area and d.area != '' and d.area not in named_areas %} {% set _ = named_areas.append(d.area) %} {% endif %} {% endfor %} {% set bound_count = devices | selectattr('board') | list | length %} {% set unbound_count = devices | length - bound_count %} {# ── Page header ──────────────────────────────────────────────────────────── #}

Devices

Virtual devices are independent app entities — bind them to hardware when needed.

{% if current_user.is_admin() %} Add Device {% endif %}
{# ── Stats bar ─────────────────────────────────────────────────────────────── #} {% if devices %}
{{ devices | length }}
Total
{{ bound_count }}
Bound
{{ unbound_count }}
Unbound
{# ── Search ────────────────────────────────────────────────────────────────── #}
{# ── Area groups ──────────────────────────────────────────────────────────── #} {% for area in named_areas %}
{{ area }}
{% for device in devices %} {% if device.area == area %}
{% include "devices/_card.html" %}
{% endif %} {% endfor %}
{% endfor %} {# ── Unbound / no-area devices ─────────────────────────────────────────────── #} {% set ungrouped = [] %} {% for d in devices %} {% if not d.area or d.area == '' %} {% set _ = ungrouped.append(d) %} {% endif %} {% endfor %} {% if ungrouped %} {% if named_areas %}
Other
{% endif %}
{% for device in ungrouped %}
{% include "devices/_card.html" %}
{% endfor %}
{% endif %} {% else %}

No devices defined yet.

{% if current_user.is_admin() %} Add your first device {% endif %}
{% endif %} {% endblock %} {% block scripts %} {% endblock %}