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>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Add Device — Battery Tracker{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Add Device</h1>
|
||||
|
||||
<div class="card">
|
||||
<form method="post" action="{{ url_for('device_add') }}">
|
||||
<div class="form-group">
|
||||
<label for="name">Device Name <span class="text-danger">*</span></label>
|
||||
<input type="text" id="name" name="name" value="{{ form_name|default('') }}"
|
||||
placeholder="e.g. Game Controller" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="battery_slots">Battery Slots <span class="text-danger">*</span></label>
|
||||
<input type="number" id="battery_slots" name="battery_slots"
|
||||
value="{{ form_slots|default(1) }}" min="1" required>
|
||||
</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 Device</button>
|
||||
<a class="btn btn-secondary" href="{{ url_for('device_list') }}">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user