709e0d6119
Uses HTML datalist populated from distinct brands in the battery table. Removed autocomplete="off" which suppresses datalist in Chrome/Chromium.
36 lines
1.3 KiB
HTML
36 lines
1.3 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Add Batteries — Battery Tracker{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1>Add Batteries</h1>
|
|
|
|
<div class="card">
|
|
<form method="post" action="{{ url_for('battery_add') }}">
|
|
<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" list="brand-list" required>
|
|
<datalist id="brand-list">
|
|
{% for b in brands|default([]) %}<option value="{{ b }}">{% endfor %}
|
|
</datalist>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="count">Quantity</label>
|
|
<input type="number" id="count" name="count" value="{{ form_count|default(1) }}" min="1" max="50">
|
|
<small class="text-muted">Labels are auto-generated (e.g. Eneloop 001, Eneloop 002)</small>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="notes">Notes</label>
|
|
<textarea id="notes" name="notes" placeholder="Optional notes applied to all batteries…">{{ form_notes|default('') }}</textarea>
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<button class="btn btn-primary" type="submit">Add Batteries</button>
|
|
<a class="btn btn-secondary" href="{{ url_for('dashboard') }}">Cancel</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|