Files
battery-tracker-app/templates/base.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

111 lines
4.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Battery Tracker{% endblock %}</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; font-size: 15px; background: #f5f5f5; color: #222; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
/* Nav */
nav {
background: #1e40af;
color: #fff;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
align-items: center;
padding: 0.75rem 1rem;
}
nav .brand { font-weight: 700; font-size: 1.1rem; margin-right: auto; color: #fff; }
nav a { color: #bfdbfe; font-size: 0.9rem; padding: 0.25rem 0.5rem; border-radius: 4px; }
nav a:hover { background: #1d4ed8; color: #fff; text-decoration: none; }
/* Layout */
.container { max-width: 960px; margin: 1.5rem auto; padding: 0 1rem; }
/* Flash messages */
.flash { padding: 0.6rem 1rem; border-radius: 4px; margin-bottom: 1rem; font-size: 0.9rem; }
.flash.success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash.error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash.warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
/* Cards / boxes */
.card { background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.1); padding: 1.25rem; margin-bottom: 1rem; }
/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 0.5rem 0.75rem; background: #f1f5f9; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; border-bottom: 2px solid #e2e8f0; }
td { padding: 0.5rem 0.75rem; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
/* Status badges */
.badge { display: inline-block; padding: 0.2em 0.55em; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-available { background: #dcfce7; color: #166534; }
.badge-installed { background: #dbeafe; color: #1e40af; }
.badge-retired { background: #f1f5f9; color: #64748b; }
.badge-warning { background: #fef9c3; color: #854d0e; }
/* Buttons */
.btn { display: inline-block; padding: 0.4rem 0.9rem; border-radius: 4px; border: none; cursor: pointer; font-size: 0.875rem; font-family: inherit; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
/* Forms */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.3rem; color: #374151; }
input[type=text], input[type=number], select, textarea {
width: 100%; padding: 0.45rem 0.65rem; border: 1px solid #d1d5db;
border-radius: 4px; font-size: 0.9rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #3b82f6; border-color: #3b82f6; }
textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 1.25rem; }
/* Headings */
h1 { font-size: 1.5rem; margin-bottom: 1rem; color: #1e293b; }
h2 { font-size: 1.15rem; margin-bottom: 0.75rem; color: #334155; }
/* Inline form (for POST buttons in tables) */
form.inline { display: inline; }
/* Warning text */
.text-warning { color: #b45309; font-size: 0.8rem; }
.text-danger { color: #dc2626; }
.text-muted { color: #6b7280; font-size: 0.85rem; }
</style>
</head>
<body>
<nav>
<span class="brand">Battery Tracker</span>
<a href="{{ url_for('dashboard') }}">Dashboard</a>
<a href="{{ url_for('device_list') }}">Devices</a>
<a href="{{ url_for('battery_add') }}">+ Battery</a>
<a href="{{ url_for('device_add') }}">+ Device</a>
</nav>
<div class="container">
{% with messages = get_flashed_messages(with_categories=true) %}
{% for category, message in messages %}
<div class="flash {{ category }}">{{ message }}</div>
{% endfor %}
{% endwith %}
{% block content %}{% endblock %}
</div>
</body>
</html>