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

{{ battery.label }}

{% macro meta_row(label, value) %} {% if value %} {{ label }} {{ value }} {% endif %} {% endmacro %}
{{ meta_row("Size", battery.size) }} {{ meta_row("Chemistry", battery.chemistry) }} {% if battery.capacity_mah %} {% elif battery.tested_capacity_mah %} {% endif %} {{ meta_row("Charge Cycles", battery.charge_cycles) }} {{ meta_row("Purchase Date", battery.purchase_date) }} {{ meta_row("Storage", battery.storage_location) }} {% if battery.notes %} {% endif %}
Label {{ battery.label }}
Brand {{ battery.brand }}
Status {{ battery.status|capitalize }}
Device {% if battery.device %} {{ battery.device.name }} {% else %} None {% endif %}
Capacity {{ battery.capacity_mah }} mAh {% if battery.tested_capacity_mah %} {% set pct = (battery.tested_capacity_mah / battery.capacity_mah * 100)|round|int %} {% if pct >= 80 %}{% set health_class = "health-good" %} {% elif pct >= 60 %}{% set health_class = "health-warn" %} {% else %}{% set health_class = "health-bad" %} {% endif %} → tested {{ battery.tested_capacity_mah }} mAh ({{ pct }}%) {% if battery.tested_date %}on {{ battery.tested_date }}{% endif %} {% endif %}
Tested Capacity {{ battery.tested_capacity_mah }} mAh {% if battery.tested_date %}on {{ battery.tested_date }}{% endif %}
Notes {{ battery.notes }}

Capacity History

{% if capacity_tests|length >= 2 %} {% endif %} {% if capacity_tests %}
{% if battery.capacity_mah %}{% endif %} {% for t in capacity_tests|sort(attribute='tested_date', reverse=True) %} {% if battery.capacity_mah %} {% set pct = (t.tested_capacity_mah / battery.capacity_mah * 100)|round|int %} {% if pct >= 80 %}{% set hc = "health-good" %} {% elif pct >= 60 %}{% set hc = "health-warn" %} {% else %}{% set hc = "health-bad" %}{% endif %} {% endif %} {% endfor %}
Date CapacityHealthNotes
{{ t.tested_date }} {{ t.tested_capacity_mah }} mAh{{ pct }}%{{ t.notes or '—' }}
{% else %}

No test records yet.

{% endif %}

Add Test Record

Charge History

{% if charge_logs %}
{% for log in charge_logs %} {% endfor %}
Date +Cycle Notes
{{ log.charged_date }} {{ '✓' if log.increment_cycles else '—' }} {{ log.notes or '—' }}
{% else %}

No charge log entries yet.

{% endif %}

Add Charge Entry

Edit Details

Actions

{% if battery.is_available() %} Assign to Device {% endif %} {% if battery.is_installed() %}
{% endif %} {% if not battery.is_retired() %}
{% else %}
{% endif %} Delete Battery
← Back to Dashboard {% endblock %}