{% extends "base.html" %} {% block title %}Devices — Battery Tracker{% endblock %} {% block content %}

Devices

+ Add Device
{% for d in devices %} {% set installed = d.effective_installed_count() %} {% set total_slots = d.effective_slots() %} {% if installed == 0 or total_slots == 0 %}{% set fill_state = 'empty' %} {% elif installed >= total_slots %}{% set fill_state = 'full' %} {% else %}{% set fill_state = 'partial' %}{% endif %} {% for child in d.children %} {% set c_installed = child.installed_count() %} {% if c_installed == 0 or child.battery_slots == 0 %}{% set c_fill = 'empty' %} {% elif c_installed >= child.battery_slots %}{% set c_fill = 'full' %} {% else %}{% set c_fill = 'partial' %}{% endif %} {% endfor %} {% else %} {% endfor %}
Name Type Size Location Slots Installed Brands Actions
{{ d.name }} {{ d.device_type or '—' }} {{ d.battery_size or '—' }} {{ d.location or '—' }} {{ total_slots }} {{ installed }} / {{ total_slots }} {% if total_slots > 0 and installed >= total_slots %} Full {% endif %} {% set brands = d.installed_brands() %} {% if brands %} {{ brands|join(', ') }} {% if d.has_mixed_brands() %} ⚠ mixed {% endif %} {% else %} {% endif %} View {% if installed > 0 %}
{% endif %}
{{ child.name }} {{ d.device_type or '—' }} {{ child.battery_size or '—' }} {{ d.location or '—' }} {{ child.battery_slots }} {{ c_installed }} / {{ child.battery_slots }} {% if child.battery_slots > 0 and c_installed >= child.battery_slots %} Full {% endif %} {% set c_brands = child.installed_brands() %} {% if c_brands %} {{ c_brands|join(', ') }} {% if child.has_mixed_brands() %} ⚠ mixed {% endif %} {% else %} {% endif %} View
No devices yet. Add one.
+ Add Device {% endblock %}