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,29 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Delete {{ battery.label }} — Battery Tracker{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Delete Battery</h1>
|
||||
|
||||
<div class="card">
|
||||
<p style="margin-bottom:1rem;">
|
||||
You are about to <strong>permanently delete</strong> battery
|
||||
<strong>{{ battery.label }}</strong> ({{ battery.brand }}).
|
||||
This action cannot be undone.
|
||||
</p>
|
||||
|
||||
{% if battery.is_installed() %}
|
||||
<p class="text-warning" style="margin-bottom:1rem;">
|
||||
⚠ This battery is currently installed in
|
||||
<strong>{{ battery.device.name }}</strong>.
|
||||
Deleting it will free that slot.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-actions">
|
||||
<form method="post" action="{{ url_for('battery_delete', battery_id=battery.id) }}">
|
||||
<button class="btn btn-danger" type="submit">Confirm Delete</button>
|
||||
</form>
|
||||
<a class="btn btn-secondary" href="{{ url_for('battery_detail', battery_id=battery.id) }}">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user