Files
battery-tracker-app/templates/battery_add.html
T
iterminate 6ea3eae981 Initial commit: Flask battery tracker app
- Flask + SQLAlchemy (MariaDB-compatible schema) battery tracking web app
- 40 pre-seeded batteries (Eneloop, BONAI, Energizer NiMH) across 5 devices
- Business rules: block retired assignment, brand-mix warnings, capacity checks
- Mobile-friendly Jinja2 templates with inline CSS
- waitress WSGI server via systemd user service (sbin/install-service.sh)
- SQLite → MariaDB migration script (migrate_to_mariadb.py)
- 26 passing acceptance tests (pytest + Flask test client)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-11 22:38:16 -05:00

42 lines
1.6 KiB
HTML

{% extends "base.html" %}
{% block title %}Add Battery — Battery Tracker{% endblock %}
{% block content %}
<h1>Add Battery</h1>
<div class="card">
<form method="post" action="{{ url_for('battery_add') }}">
<div class="form-group">
<label for="label">Label <span class="text-danger">*</span></label>
<input type="text" id="label" name="label" value="{{ form_label|default('') }}"
placeholder="e.g. ENL-17" required>
</div>
<div class="form-group">
<label for="brand">Brand <span class="text-danger">*</span></label>
<input type="text" id="brand" name="brand" value="{{ form_brand|default('') }}"
placeholder="e.g. Panasonic Eneloop" required>
</div>
<div class="form-group">
<label for="status">Initial Status</label>
<select id="status" name="status">
<option value="available" {% if form_status|default('available') == 'available' %}selected{% endif %}>Available</option>
<option value="installed" {% if form_status|default('') == 'installed' %}selected{% endif %}>Installed</option>
<option value="retired" {% if form_status|default('') == 'retired' %}selected{% endif %}>Retired</option>
</select>
</div>
<div class="form-group">
<label for="notes">Notes</label>
<textarea id="notes" name="notes" placeholder="Optional notes…">{{ form_notes|default('') }}</textarea>
</div>
<div class="form-actions">
<button class="btn btn-primary" type="submit">Add Battery</button>
<a class="btn btn-secondary" href="{{ url_for('dashboard') }}">Cancel</a>
</div>
</form>
</div>
{% endblock %}