768f83f63a
- Dark mode via prefers-color-scheme: pure CSS, no JS, follows OS setting - CSS custom properties for all colors; dark palette redefines variables - Nav: brand is now a home link, Dashboard link removed, nowrap keeps it single-line on mobile; compact padding at 640px breakpoint - Battery health % uses CSS classes (health-good/warn/bad) instead of inline Jinja colors — readable in both light and dark modes - Stat card counts use CSS color variables for dark mode support - Fix duplicate display:none on bulk toolbar - input[type=date] added to themed input selector
49 lines
2.3 KiB
HTML
49 lines
2.3 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Assign {{ battery.label }} — Battery Tracker{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>Assign {{ battery.label }}</h1>
|
|
<p class="text-muted" style="margin-bottom:1rem;">Brand: {{ battery.brand }}</p>
|
|
|
|
<div class="card">
|
|
{% if devices %}
|
|
<form method="post" action="{{ url_for('battery_assign', battery_id=battery.id) }}">
|
|
<div class="form-group">
|
|
<label>Select Device</label>
|
|
{% for device in devices %}
|
|
{% set full = device.installed_count() >= device.battery_slots %}
|
|
{% set mix = device.installed_brands() and battery.brand not in device.installed_brands() %}
|
|
<div class="device-option" style="margin-bottom:0.75rem;padding:0.75rem;border:1px solid #e2e8f0;border-radius:4px;
|
|
{% if full %}opacity:0.5;{% endif %}background:#fff;">
|
|
<label style="display:flex;align-items:center;gap:0.6rem;font-weight:normal;min-height:44px;cursor:{% if full %}not-allowed{% else %}pointer{% endif %};">
|
|
<input type="radio" name="device_id" value="{{ device.id }}"
|
|
{% if full %}disabled{% endif %}
|
|
style="cursor:{% if full %}not-allowed{% else %}pointer{% endif %};">
|
|
<span>
|
|
<strong>{{ device.name }}</strong>
|
|
<span class="text-muted">({{ device.installed_count() }}/{{ device.battery_slots }} slots used)</span>
|
|
{% if full %}
|
|
<span class="badge badge-retired">Full</span>
|
|
{% endif %}
|
|
</span>
|
|
</label>
|
|
{% if mix and not full %}
|
|
<p class="text-warning" style="margin-top:0.3rem;margin-left:1.6rem;">
|
|
⚠ Already has {{ device.installed_brands()|join(', ') }} — mixing brands not recommended.
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<button class="btn btn-primary" type="submit">Assign Battery</button>
|
|
<a class="btn btn-secondary" href="{{ url_for('battery_detail', battery_id=battery.id) }}">Cancel</a>
|
|
</div>
|
|
</form>
|
|
{% else %}
|
|
<p class="text-muted">No devices exist yet. <a href="{{ url_for('device_add') }}">Add a device first.</a></p>
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|